From patchwork Fri Apr 12 18:46:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 788522 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 914DC14F9E5; Fri, 12 Apr 2024 18:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712947681; cv=none; b=F7ZcgkJfk7IboM+5B4e/kxg/3YDjY/HJVuVA6oQIHhjCf/lVTr66AA4T2VR2HnOFBolg32oTyJYogRi29NAUoawewPaIIRdVv2AwgbyAwr36N6TFiEuEpwE+dHooFLkyrZ1/MRFzkXv7mdP6BR0LXpBuFvZJQskqR9CMYA2JN0k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712947681; c=relaxed/simple; bh=keDoBh4N1bcwvDCmZ/4Sw+askjtG52PpwtQLSYVexTQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ia7GGHywZWvt7i+zx/qpeGCONErMZHVaJKjoyO40HDOGF+YyB1OG24zlr9V7Oei1L8F4d/mzgEtYKJuexCPLOu0bvwNQ00EdPY6t1N1Lpit9UGwYBcRdhTIzv7dJcebGmgrO9TLerQi+PCVokVw/VlbSvLFHbQlxxOH3hWoWy/U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ElOCP1UC; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ElOCP1UC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712947680; x=1744483680; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=keDoBh4N1bcwvDCmZ/4Sw+askjtG52PpwtQLSYVexTQ=; b=ElOCP1UC4ZsgzfZ3HdgyBeo4lfhKL/rnGiNV4PvV+1CIyGTXptYzytpj hA35PsB3aIq68Pyg5HXGammFNbNB+JwQGvRSi6sWaV4mmV95joJ3VSEE5 xdaX190NIEC0NJdzu1OMNJ5Da6KXV5opjeILP86Chg513m8VqBvKamnKV doI4e5iUO+VgcUjkQIN38J1TpKZd14eRSbGfv/ofNIw21G/0ci8/h+lXG /viweyr29WlCl2M//cKsTmEgfSfP+JTSJZ/Y3eq+2hnX4gM6pbjF1P46y LL0J3116gv5DTvgT00ZwpEo9bo2y65i5FmasezMHJSTeuJR6L0dxdmz5F g==; X-CSE-ConnectionGUID: 3yq5Mk9pT0iWRWEPfkfb+Q== X-CSE-MsgGUID: BNIcyvTvSDigDinWNKNvHA== X-IronPort-AV: E=McAfee;i="6600,9927,11042"; a="12204630" X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="12204630" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 11:47:58 -0700 X-CSE-ConnectionGUID: naEweZgzSYu3OoKG3qx0FQ== X-CSE-MsgGUID: 5Xuofn8YRf6H/gbqBXlGKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="58725386" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa001.jf.intel.com with ESMTP; 12 Apr 2024 11:47:56 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 13977FF; Fri, 12 Apr 2024 21:47:55 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Adrian Hunter , Ulf Hansson Subject: [PATCH v1 1/2] mmc: sdhci-acpi: Switch to SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() and pm_ptr() Date: Fri, 12 Apr 2024 21:46:20 +0300 Message-ID: <20240412184706.366879-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240412184706.366879-2-andriy.shevchenko@linux.intel.com> References: <20240412184706.366879-2-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are deprecated now and require an ifdeffery protection against unused function warnings. The usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() allows the compiler to see the functions, thus suppressing the warning. Thus drop the ifdeffery protection. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index acf5fc3ad7e4..32ae6f763c1d 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -957,8 +957,6 @@ static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed( } } -#ifdef CONFIG_PM_SLEEP - static int sdhci_acpi_suspend(struct device *dev) { struct sdhci_acpi_host *c = dev_get_drvdata(dev); @@ -985,10 +983,6 @@ static int sdhci_acpi_resume(struct device *dev) return sdhci_resume_host(c->host); } -#endif - -#ifdef CONFIG_PM - static int sdhci_acpi_runtime_suspend(struct device *dev) { struct sdhci_acpi_host *c = dev_get_drvdata(dev); @@ -1015,12 +1009,9 @@ static int sdhci_acpi_runtime_resume(struct device *dev) return sdhci_runtime_resume_host(c->host, 0); } -#endif - static const struct dev_pm_ops sdhci_acpi_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume) - SET_RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend, - sdhci_acpi_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(sdhci_acpi_suspend, sdhci_acpi_resume) + RUNTIME_PM_OPS(sdhci_acpi_runtime_suspend, sdhci_acpi_runtime_resume, NULL) }; static struct platform_driver sdhci_acpi_driver = { @@ -1028,7 +1019,7 @@ static struct platform_driver sdhci_acpi_driver = { .name = "sdhci-acpi", .probe_type = PROBE_PREFER_ASYNCHRONOUS, .acpi_match_table = sdhci_acpi_ids, - .pm = &sdhci_acpi_pm_ops, + .pm = pm_ptr(&sdhci_acpi_pm_ops), }, .probe = sdhci_acpi_probe, .remove_new = sdhci_acpi_remove, From patchwork Fri Apr 12 18:46:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 788523 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27CC014F9D7; Fri, 12 Apr 2024 18:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712947679; cv=none; b=YPKogkPU0//Nhw43SiV+sUB/9xS9QEg85paA/HsFRTxo9vVrxH85jDi7eFk5z2nl9vvYIYxUUCYiQlSAgweBhAj/ulbJ8PrYY4569gmk/SFEi1S87xuBY1L0pkz5Mprz75dWkFIbuMJCDpTqyJZxjWCfPtvvcWcwZlJA4fTO18M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712947679; c=relaxed/simple; bh=qNwaH9FoWBTAdA5ghiLL6X1/WsUFM5GWDUFnPLH5qSM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DPlEI5AZSH+RB3n01HlXImGluT2ePqSR9u3uknA+xQTkxLNMB0NFr75IUfBvLb8DS2HIiekNjBmVJ1ZO3si71quav1tliwm/SZZaHK4zLRQDtCofbXZWyAmGa4N+OkwmrUxGeEpAfXnHjp/w48s4tfk0o7btkM7DT9MDLtwbQis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=PvsD2jfB; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="PvsD2jfB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712947678; x=1744483678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qNwaH9FoWBTAdA5ghiLL6X1/WsUFM5GWDUFnPLH5qSM=; b=PvsD2jfBBcSBZchkQThnlaBrdmCkIpO0X4Yg4BSZKB/wFUjN2SB9h0Ow 8TqQMpoWWnYeXJ2yRIEEaUgJYhGFS12HOe0AgZNH3sHlrlPHPkNp+D0IF 18keApwAKWEO/uBUTFU3uNNaEXwLcsrmcKMOKsNVw9meZ4D31RgnYE6D4 IFgj8SIHEKqzj11ZXvZiW5+crkJWYxsvGERPn39EK77BIXPbt+tNQ94hB iSM3Uq40oLYgtNFFpvk3rKh7D496c/wVgXvU0GswSphEIlTz6HZhPFR1U m0AJGk8uKwUzkIPJOSJXScv6Zg/5n1+QO1gytFmbsomTCdGfRMw4lQNFa g==; X-CSE-ConnectionGUID: ptA1TsM4SsSXPZqRh27TbQ== X-CSE-MsgGUID: H2yytqZWRWm7AWjf2wr83A== X-IronPort-AV: E=McAfee;i="6600,9927,11042"; a="8333189" X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="8333189" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Apr 2024 11:47:58 -0700 X-CSE-ConnectionGUID: pj9FaUm4SIWVi/UmnAvSsw== X-CSE-MsgGUID: 8U1PKzKvTKmf/o+lukE73A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,196,1708416000"; d="scan'208";a="25856201" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa003.fm.intel.com with ESMTP; 12 Apr 2024 11:47:56 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 249612BE; Fri, 12 Apr 2024 21:47:55 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Adrian Hunter , Ulf Hansson Subject: [PATCH v1 2/2] mmc: sdhci-acpi: Use devm_platform_ioremap_resource() Date: Fri, 12 Apr 2024 21:46:21 +0300 Message-ID: <20240412184706.366879-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240412184706.366879-2-andriy.shevchenko@linux.intel.com> References: <20240412184706.366879-2-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The struct resource is not used for anything else, so we can simplify the code a bit by using the helper function. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 32ae6f763c1d..b9c8eb87a01a 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -779,8 +779,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev) struct acpi_device *device; struct sdhci_acpi_host *c; struct sdhci_host *host; - struct resource *iomem; - resource_size_t len; size_t priv_size; int quirks = 0; int err; @@ -801,17 +799,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev) if (sdhci_acpi_byt_defer(dev)) return -EPROBE_DEFER; - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!iomem) - return -ENOMEM; - - len = resource_size(iomem); - if (len < 0x100) - dev_err(dev, "Invalid iomem size!\n"); - - if (!devm_request_mem_region(dev, iomem->start, len, dev_name(dev))) - return -ENOMEM; - priv_size = slot ? slot->priv_size : 0; host = sdhci_alloc_host(dev, sizeof(struct sdhci_acpi_host) + priv_size); if (IS_ERR(host)) @@ -833,10 +820,9 @@ static int sdhci_acpi_probe(struct platform_device *pdev) goto err_free; } - host->ioaddr = devm_ioremap(dev, iomem->start, - resource_size(iomem)); - if (host->ioaddr == NULL) { - err = -ENOMEM; + host->ioaddr = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(host->ioaddr)) { + err = PTR_ERR(host->ioaddr); goto err_free; }