From patchwork Fri Nov 1 10:11:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 840345 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 892E116130B; Fri, 1 Nov 2024 10:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456092; cv=none; b=sWNRRufsVNmUHkpsDkkceOouX9wK1ZwYsTUr31VBy4tIXKGfm2yp1pzSG1e3wenU4+oQnvznb283mJyrEg7kIqcaplapPZX9aC8IB3NjvDUby6e+7N7lhgQTuAtcYS8vnsI/Wn5fTExYsyCsfbwHodDmDWttWF71MIK0HJUgHEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456092; c=relaxed/simple; bh=ve3K/lXNYQwypP2f7KcCRz8bMHtlMdKOO3fvsCfZ1JA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cS2unwYiyvZsIwlotm8CXuy4iLPf1H+WXzBSuzxRbQgyApAxPMFF606p+d/yzw9VGYoXvpq0foDW70hDzDkoGkB6hI8m/1mAiTvp4PuGdSZ/BuafWWfrsZpLRGut65fr0d8ERgByHHm1leIFexef7c45TkG1ffQ6IaI93bCxG70= 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=c7hzPvKE; arc=none smtp.client-ip=198.175.65.12 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="c7hzPvKE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730456091; x=1761992091; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ve3K/lXNYQwypP2f7KcCRz8bMHtlMdKOO3fvsCfZ1JA=; b=c7hzPvKEhUR4RyBHgIXz9K9ObUkPO5Im2X1j7oMofxHPdSDGLHh9EYH0 e71c8pPHV1gJ1+TbFLSa0YM9YrYCfrrleNmxoYr+pyNn8prEmh4VuH5pV ZMBylegvepHMRVkd25Wv5mkgHty9rmO/1ACk8k04mApk00p6OOOM9Z13Y uhKFKEARH9ar3BMmM/v76tQmgqwy4clzy7HI3bK3BlnA0OGYxbTLwo7Pv HrsmQZqj8UIL6tr9Jjr5VTSHX8VuMjZM4F8GNxOIco19aKyPU0NEijS1j yb1eTZdSTxGJJeY1c70CI1jMSKTalSEH+x7iA/J5NeMbitqbijQqEZTeJ g==; X-CSE-ConnectionGUID: XeCnhqjdShaOaz5CphRJxg== X-CSE-MsgGUID: DQS6nwKsTsOTw1IbCAeCpA== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="41615780" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="41615780" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 03:14:48 -0700 X-CSE-ConnectionGUID: M2i3My2CRS+BN4LjNPRqNA== X-CSE-MsgGUID: dac6a0PDSCStgMuSt2Y2fA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83737451" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 01 Nov 2024 03:14:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id AC06893; Fri, 01 Nov 2024 12:14:44 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Adrian Hunter , Victor Shih , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/6] mmc: sdhci: Use EXPORT_PM_FN_NS_GPL() for exporting PM functions Date: Fri, 1 Nov 2024 12:11:31 +0200 Message-ID: <20241101101441.3518612-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101101441.3518612-1-andriy.shevchenko@linux.intel.com> References: <20241101101441.3518612-1-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 Switch from ugly ifdeffery to using EXPORT_PM_FN_NS_GPL() for exporting PM functions. This helps cleaning up the other SDHCI drivers in the future. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci.c | 14 ++++---------- drivers/mmc/host/sdhci.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f4a7733a8ad2..2214280ca5fb 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3733,8 +3733,6 @@ EXPORT_SYMBOL_GPL(sdhci_thread_irq); * * \*****************************************************************************/ -#ifdef CONFIG_PM - static bool sdhci_cd_irq_can_wakeup(struct sdhci_host *host) { return mmc_card_is_removable(host->mmc) && @@ -3814,8 +3812,7 @@ int sdhci_suspend_host(struct sdhci_host *host) return 0; } - -EXPORT_SYMBOL_GPL(sdhci_suspend_host); +EXPORT_PM_FN_GPL(sdhci_suspend_host); int sdhci_resume_host(struct sdhci_host *host) { @@ -3853,8 +3850,7 @@ int sdhci_resume_host(struct sdhci_host *host) return ret; } - -EXPORT_SYMBOL_GPL(sdhci_resume_host); +EXPORT_PM_FN_GPL(sdhci_resume_host); int sdhci_runtime_suspend_host(struct sdhci_host *host) { @@ -3876,7 +3872,7 @@ int sdhci_runtime_suspend_host(struct sdhci_host *host) return 0; } -EXPORT_SYMBOL_GPL(sdhci_runtime_suspend_host); +EXPORT_PM_FN_GPL(sdhci_runtime_suspend_host); int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset) { @@ -3927,9 +3923,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset) return 0; } -EXPORT_SYMBOL_GPL(sdhci_runtime_resume_host); - -#endif /* CONFIG_PM */ +EXPORT_PM_FN_GPL(sdhci_runtime_resume_host); /*****************************************************************************\ * * diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index cd0e35a80542..4ee2695b0202 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -874,12 +874,10 @@ irqreturn_t sdhci_thread_irq(int irq, void *dev_id); void sdhci_adma_write_desc(struct sdhci_host *host, void **desc, dma_addr_t addr, int len, unsigned int cmd); -#ifdef CONFIG_PM int sdhci_suspend_host(struct sdhci_host *host); int sdhci_resume_host(struct sdhci_host *host); int sdhci_runtime_suspend_host(struct sdhci_host *host); int sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset); -#endif void sdhci_cqe_enable(struct mmc_host *mmc); void sdhci_cqe_disable(struct mmc_host *mmc, bool recovery); From patchwork Fri Nov 1 10:11:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 840230 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 0D36515A85A; Fri, 1 Nov 2024 10:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456092; cv=none; b=OP019hp77ojS6ReWPFenlPZzFRq1vzRtwlzfWbNJXyiaktxPuK/t0XZDnKdNCqcXQE/isrNqsDprFexPgQ+3yXdJBXljMHeq/jWyhaOjDPBOtg44PojdilCRLza3jIsQrXxNvpYgJWlf9GQNpNLb8YgSXnQxNQKyXvs0NkRJ7/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456092; c=relaxed/simple; bh=6qxhurwg7wQQ0SVBWF79JClFB8oz8njwIY/xTqVlC6Y=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rZ9uMNv4DOZqm3n1Kgd0g6w3UMesFhwSSXL84ycOsswmL2Fqxi0x3CDMn82xVpB3WMqwgzfOKWqFohS7bqlJNj7ClZXZGYrnLL4YGfN1fNuk/v93L0Mtd+kD4Gp75JQhT1AEArhkPsyuzY+4xYslrCq1X8+AjkbYYSdFdVLARwA= 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=TPLNSxu+; arc=none smtp.client-ip=198.175.65.13 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="TPLNSxu+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730456090; x=1761992090; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=6qxhurwg7wQQ0SVBWF79JClFB8oz8njwIY/xTqVlC6Y=; b=TPLNSxu+ju4euZXHHAwYWknXkcEojYRC0EJQFFhnSliPJZdYaLZTOXtm UvLXJDTfkGnh5mG9UajY/pEqy81xWOaWp2buW1ESBvH8ZSGTJ/Ty+QWLw BcIrl91Nh0LxD3oaQ1ZA+XMF9C50W7hbuk5oGrlqIzXdFkwU0ECJSIf5M UujSU9fDOhcTafdGtracE3v37sSfpSfapf2BywKc27VN2bEwqPJ1hOJMN GQVgIFWjISUyuhPWMENdJJtRjwZDyjAqMpCvkOgoCNMI6qaSb0+52llvj s/kPU2w+kEOxNVpRtwsX2Vwh//TfWADd5Sz0inAIWEC5YCqQA3mb+Dm7S w==; X-CSE-ConnectionGUID: bi3mt5f4TdeF1aXBo2TcWw== X-CSE-MsgGUID: 1EbBQ+eRQ1OkjE0Vdl1zhg== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="41319316" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="41319316" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 03:14:48 -0700 X-CSE-ConnectionGUID: yBkLw6+DSU27Dv0cKy3V2Q== X-CSE-MsgGUID: THeCa9/5Q26IXzgIGBEpWA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83355129" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 01 Nov 2024 03:14:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B50B22AF; Fri, 01 Nov 2024 12:14:44 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Adrian Hunter , Victor Shih , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/6] mmc: sdhci-acpi: Switch to SYSTEM_SLEEP_PM_OPS()/RUNTIME_PM_OPS() and pm_ptr() Date: Fri, 1 Nov 2024 12:11:32 +0200 Message-ID: <20241101101441.3518612-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101101441.3518612-1-andriy.shevchenko@linux.intel.com> References: <20241101101441.3518612-1-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 d1ce9193ece9..5241c5c26891 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -1006,8 +1006,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); @@ -1034,10 +1032,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); @@ -1064,12 +1058,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 = { @@ -1077,7 +1068,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 = sdhci_acpi_remove, From patchwork Fri Nov 1 10:11:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 840346 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 18BE015CD79; Fri, 1 Nov 2024 10:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456091; cv=none; b=auS8CXOvgfPo7ocJwJDX86H4410bCbGmzFAmKU4q1vP6YIavZ02hMJzHdoWQVeF6pvouRrGYLBLPJEMKJP6IrVeekcnFiuFVlVq6XBUlbvrwcRHvXrLpF8xZEZVMPut3lscTj91+72yDm/YlUaZCUtcNxeCOu/LAMdFwCbSLato= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456091; c=relaxed/simple; bh=/Ry/rhneHzO67eKiUEYUc3v+cRjG9wMg1M/PNgw3zNc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a33MVxgU7olDncbexBDFp42G93gJu5KVOo1Lf7OD282Kjrk6+JfvKpe1P1WE+c0fnil2cYBatsZ0dEzU8gtrP5JgBVWxMC51bwzASnhF77bQsvHjf+cLWR9kx7TqrcUv8tXfkNmXBue6A6boG3dCNOtYUMLKG/npEkLHGrtLjPA= 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=cHRPErHd; arc=none smtp.client-ip=198.175.65.12 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="cHRPErHd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730456090; x=1761992090; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/Ry/rhneHzO67eKiUEYUc3v+cRjG9wMg1M/PNgw3zNc=; b=cHRPErHdawnAeDrgzDtguh7scC4itiKmjjl0aRdtV5USeeuv8Zyipr2c HqYN1v7xAJJoUrJiapFO3EepYxtpO2R1jGhQqE66fGXK9wBRRi58KUHDp UR2LWQHVtCn0AOtlFmNdpxW75ek6AIgkRXx2zBAUZjF2rfIGAhWmOiuNF 0iBFxvRv/++FHOze98/p/EC1iKQZfXR/thWUDg8uvD6pDEJzgkKnqTfpy wzOVvVrU8pXOLhAuv7/+KisOcQu1ozuOPVlHgZlU8Z/eTaGmxGjVX8dKR x9gos2LkpuPVy4xXHuTnaShHPs5nNRFUwcIs8qCVP+h2qa9bpfhgy+Ye4 A==; X-CSE-ConnectionGUID: j5GJ8EbnTFq4xZ1CcK002g== X-CSE-MsgGUID: 2ixBuG6LTpaWKxK23+pg+g== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="41615773" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="41615773" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 03:14:48 -0700 X-CSE-ConnectionGUID: uTNBC3DbQxCHRDzZ8rlY4A== X-CSE-MsgGUID: nuzI/wSPRHmn56OjpgPZJQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83737447" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 01 Nov 2024 03:14:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C8AA0357; Fri, 01 Nov 2024 12:14:44 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Adrian Hunter , Victor Shih , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/6] mmc: sdhci-acpi: Remove not so useful error message Date: Fri, 1 Nov 2024 12:11:33 +0200 Message-ID: <20241101101441.3518612-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101101441.3518612-1-andriy.shevchenko@linux.intel.com> References: <20241101101441.3518612-1-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 First of all, this error message is just informative and doesn't prevent driver from going on. Second, the ioremap() on many architectures just works on page size granularity, which is higher than 256 bytes. Last, but not lease, this is an impediment for furhter cleanups, hence remove it. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 5241c5c26891..f861e9a3a911 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -849,9 +849,6 @@ static int sdhci_acpi_probe(struct platform_device *pdev) 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; From patchwork Fri Nov 1 10:11:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 840231 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 133F115B54A; Fri, 1 Nov 2024 10:14:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456090; cv=none; b=mihxm5ra6QPIftoF9mPlBpJnqFP47AWjDfv0kvrxlbmRog93T78yYhKE9639/6GOuyoLLv12y/6Bw/NZYfBLKhXUpxkeHOk9J/5SP4WcHUzoHFX3lNGcq1w5A1jEFSpy283CKeSne5idTwT+Uhhx9t6QKSMMUXc/uO3cWzQytDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456090; c=relaxed/simple; bh=z0iIdso+J7LGPzcPMzboewHXIyjSWL2bxSuCGFnjYCw=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pH6dAyfSM3znOaio6LDheqmmI80eg5UmBYhzTamgOk8vRaTWgYSygSnYMkDAt20zw+YhBeVgqqCFx+AQpixWb/uWwg9L9jHeDjqK5ASorYtBt/cEa5issR47HKB8CCy7JQ5T1F2cNbouBjTRs4vpA6fL+wcgkq+c1pMqzYlMjXw= 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=hmKs60/q; arc=none smtp.client-ip=198.175.65.12 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="hmKs60/q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730456088; x=1761992088; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=z0iIdso+J7LGPzcPMzboewHXIyjSWL2bxSuCGFnjYCw=; b=hmKs60/q4AoeQJx7B6dpEI2yKful+cc2LByjrBV6QSY7FkQ1yGaVCSRP Erbiy9uRv/E73xRHvkLX1t9KlWrmS69fvCQYKB7vO3pXVibrnrco4jHQE b1usOhXLNaUNjTNRHFTYJ9q33tzFnOuw8QplKcwl2QQXD8IIwd2bNBMxk vnHKbcVIuD7lt5ZSabGzULsVEKyK/czjd2lIMGr0khnwJpCkWqxClkosr homhs9sYaj66o0hv0wYlJaQvq06I6WS20GcjGRtrV5p7jZMPf5f0CazqQ WkLlwPcvO2xGP5+ldDui/W5eAAMbYK5Yu7F2vQRDULqK5kDaDCSgclUu9 g==; X-CSE-ConnectionGUID: Hrim4uOUS9apWEXGLDBoYg== X-CSE-MsgGUID: vCasybZERbqEZUwOo8Ip+A== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="41615776" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="41615776" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 03:14:48 -0700 X-CSE-ConnectionGUID: y6ilDAbzT2G4aKHGcKCVkQ== X-CSE-MsgGUID: PAd6ENQsT02Uhn596ZAvZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83737449" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 01 Nov 2024 03:14:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id CEA732D3; Fri, 01 Nov 2024 12:14:44 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Adrian Hunter , Victor Shih , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/6] mmc: sdhci-acpi: Use devm_platform_ioremap_resource() Date: Fri, 1 Nov 2024 12:11:34 +0200 Message-ID: <20241101101441.3518612-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101101441.3518612-1-andriy.shevchenko@linux.intel.com> References: <20241101101441.3518612-1-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 | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index f861e9a3a911..8e265b53d7ce 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -822,8 +822,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; @@ -844,14 +842,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 (!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)) @@ -873,10 +863,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; } From patchwork Fri Nov 1 10:11:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 840229 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 10C08176FA2; Fri, 1 Nov 2024 10:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456094; cv=none; b=aC2KphvIez/b+W0e6isK9cGk6Z7ZdcATgS36487TZv3XbdXtXc0dL2ZrnMK+j+gvhP9hqEgZ5hP9Ye1KImd+lAdAc7DKvT52YicUgYPRnCZXfshfmCz6UK+qWzKO/eZpYnpsM1TZJicPATBQb57ip4RItsgxDlMvxKuq+rgPz2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456094; c=relaxed/simple; bh=ZmjTPYPWQVUuwBtqZF1mpWHidFQ1gO6jSMVLiuRlQeg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nxIUrAbuAvOnsxC6cnzDgs15ypJpGxVHV6UVSwdM/moIm1qG8x8lNs2rMyWH/arsxGWnqVxBs2NsEV82n2vLTtMf99DFBsphOINseXvJKAqjKwNe/Pf92BQdfiJc10EdIwJ4Jg7Q9IKJs63k9iZ8Bl0BN0659o0wdF4SGOJpr1o= 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=T19DgyAX; arc=none smtp.client-ip=198.175.65.12 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="T19DgyAX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730456092; x=1761992092; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ZmjTPYPWQVUuwBtqZF1mpWHidFQ1gO6jSMVLiuRlQeg=; b=T19DgyAXx6eLmalJTRrmxpEzT/TDLjmfFWihOyWWDhhueigSGivVfBBR aAcKswCO5XCdrSh/YXgFBMSOHGc+paSLGlrE1DM9Im6/rNoUhgDyBUAG6 j0idqfoWjcTTv4GWiPE/bsFenZtM0OGWhNjNefrtNwiG6N51W5SCNWC0Z tz7BqmCF44KiqxMJpAzHOYXgpok04N99paizg9TA1nC35zH1XSddQLzW2 xEcDEJwwivsyqz80TZeZbk3l+b4/BSYSy1Ejkgy0s73gTzY6YkzD8tvxu u8XeEbnzG5cvFlwGNDwgMPKR0LoCpoFSb2QkbcTXMFEbBjYzgYmDyZNvY A==; X-CSE-ConnectionGUID: ukabWDtqSEWduozrTkBCBQ== X-CSE-MsgGUID: ATc9IYLjR2qqZD7jnv4Rww== X-IronPort-AV: E=McAfee;i="6700,10204,11242"; a="41615782" X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="41615782" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 03:14:50 -0700 X-CSE-ConnectionGUID: lLxddGjXTKqOmb9rE83F1g== X-CSE-MsgGUID: +PzIKr/zS46Gi1VazdQK7g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83737457" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 01 Nov 2024 03:14:49 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DD9CA44B; Fri, 01 Nov 2024 12:14:44 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Adrian Hunter , Victor Shih , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] mmc: sdhci-acpi: Tidy up ACPI ID table Date: Fri, 1 Nov 2024 12:11:35 +0200 Message-ID: <20241101101441.3518612-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101101441.3518612-1-andriy.shevchenko@linux.intel.com> References: <20241101101441.3518612-1-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 Tidy up ACPI ID table: - sort entries alphabetically for better maintenance - drop comma in the terminator entry Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 8e265b53d7ce..c931f506c1b0 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -682,33 +682,35 @@ struct sdhci_acpi_uid_slot { }; static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = { - { "80865ACA", NULL, &sdhci_acpi_slot_int_sd }, - { "80865ACC", NULL, &sdhci_acpi_slot_int_emmc }, - { "80865AD0", NULL, &sdhci_acpi_slot_int_sdio }, { "80860F14" , "1" , &sdhci_acpi_slot_int_emmc }, { "80860F14" , "2" , &sdhci_acpi_slot_int_sdio }, { "80860F14" , "3" , &sdhci_acpi_slot_int_sd }, { "80860F16" , NULL, &sdhci_acpi_slot_int_sd }, + { "80865ACA", NULL, &sdhci_acpi_slot_int_sd }, + { "80865ACC", NULL, &sdhci_acpi_slot_int_emmc }, + { "80865AD0", NULL, &sdhci_acpi_slot_int_sdio }, + { "AMDI0040", NULL, &sdhci_acpi_slot_amd_emmc }, + { "AMDI0041", NULL, &sdhci_acpi_slot_amd_emmc }, { "INT33BB" , "2" , &sdhci_acpi_slot_int_sdio }, { "INT33BB" , "3" , &sdhci_acpi_slot_int_sd }, { "INT33C6" , NULL, &sdhci_acpi_slot_int_sdio }, { "INT3436" , NULL, &sdhci_acpi_slot_int_sdio }, { "INT344D" , NULL, &sdhci_acpi_slot_int_sdio }, - { "PNP0FFF" , "3" , &sdhci_acpi_slot_int_sd }, { "PNP0D40" }, + { "PNP0FFF" , "3" , &sdhci_acpi_slot_int_sd }, { "QCOM8051", NULL, &sdhci_acpi_slot_qcom_sd_3v }, { "QCOM8052", NULL, &sdhci_acpi_slot_qcom_sd }, - { "AMDI0040", NULL, &sdhci_acpi_slot_amd_emmc }, - { "AMDI0041", NULL, &sdhci_acpi_slot_amd_emmc }, - { }, + { } }; static const struct acpi_device_id sdhci_acpi_ids[] = { + { "80860F14" }, + { "80860F16" }, { "80865ACA" }, { "80865ACC" }, { "80865AD0" }, - { "80860F14" }, - { "80860F16" }, + { "AMDI0040" }, + { "AMDI0041" }, { "INT33BB" }, { "INT33C6" }, { "INT3436" }, @@ -716,9 +718,7 @@ static const struct acpi_device_id sdhci_acpi_ids[] = { { "PNP0D40" }, { "QCOM8051" }, { "QCOM8052" }, - { "AMDI0040" }, - { "AMDI0041" }, - { }, + { } }; MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids); From patchwork Fri Nov 1 10:11:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 840344 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (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 35A841885B0; Fri, 1 Nov 2024 10:14:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456094; cv=none; b=AemAuqHpY/jUCG0ErLTu8k4Px6oj65DEgwyEsb67FqT+Vpob4LVSOUcLStry++OofPuxSa6VENtsSlOyldqAbhvwjPkCHsqodSLRSfEi8l7FVKyISV8falxy/cDA93OrO3FxCGk8l7EgwlH6Lu1LF2qQ6fG+EB60d2JU8UiOWTQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730456094; c=relaxed/simple; bh=bHJR8SM95eGim0uQIvrzDUF6VWp5MUoPqulcvUcx1GQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a1cjAtyWXqF67uIs0rNh/0+HB+si4buBMlQz+ub8IWXW1PlHj+rPiblqCkLQDOqsuIOSVYFcV2WaPXZ4I0X8dR5abcJUkpRf4RQbamh2N4XYP69OZf9D1NxMR+19/V2CpXWQAKJaO6Is3BeXCw1OKvnnHdEOWxdWIbj5Q/hW9tg= 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=IAeNOTzh; arc=none smtp.client-ip=198.175.65.13 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="IAeNOTzh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1730456092; x=1761992092; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=bHJR8SM95eGim0uQIvrzDUF6VWp5MUoPqulcvUcx1GQ=; b=IAeNOTzhY49/U83O+Fj0nKCoyOG/p91/YRsbPsQC3U2jddITqOmwYqtw EbhKbE8O8y8ZsPYGFvyLsFXfiMZZZiO0TbA2T2nABTPKnRscLHkty046Q 1RC7oAuutZ6+OReDmCvdx2S1KhrkqXxx7z+WenvqPKlkPx0BVV6HXmh1Q vAEAafVpn9W+8dj/OpBKEA3UyA8pbfgvc3hMip5n0caWhYD+KwXnexdbv UtSYUVXvBDODKVqQuxjcOhLQudukmEaMLd4JvA6F28T2R/NYn3FAAFPEu s23P4Koep7hhntKcof5JTDXcoD5oh8vg+DFXjsumT5b47gro+LiIeQLQ1 Q==; X-CSE-ConnectionGUID: 1ymS2PVKT2Kzk1OV/b4zIw== X-CSE-MsgGUID: nOb9I6eZT/amuI/kb6mZxQ== X-IronPort-AV: E=McAfee;i="6700,10204,11222"; a="41319320" X-IronPort-AV: E=Sophos;i="6.11,199,1725346800"; d="scan'208";a="41319320" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2024 03:14:50 -0700 X-CSE-ConnectionGUID: tc/e7HAwRheFgO4+/uctqg== X-CSE-MsgGUID: Rb3ip6b4THW6jI26P96O2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,249,1725346800"; d="scan'208";a="83355133" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 01 Nov 2024 03:14:49 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E329D3AD; Fri, 01 Nov 2024 12:14:44 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Ulf Hansson , Adrian Hunter , Victor Shih , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/6] mmc: sdhci-acpi: Don't use "proxy" headers Date: Fri, 1 Nov 2024 12:11:36 +0200 Message-ID: <20241101101441.3518612-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20241101101441.3518612-1-andriy.shevchenko@linux.intel.com> References: <20241101101441.3518612-1-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 Update header inclusions to follow IWYU (Include What You Use) principle. While at it, sort them alphabetically for better maintenance. Signed-off-by: Andy Shevchenko --- drivers/mmc/host/sdhci-acpi.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index c931f506c1b0..fcb69a509c1e 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -5,27 +5,30 @@ * Copyright (c) 2012, Intel Corporation. */ +#include #include -#include -#include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include +#include +#include +#include #include #include