From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7D431292B38; Fri, 15 Aug 2025 01:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222719; cv=none; b=mlJVfnLiqxhJj8ZQGvr8dvCgPIlvPcYwuxew7U6WQPmzKlrlrIuScMQCASsAhjvV5M+I+vBu/qBADe7yBTTz/8eALIrfH2mU7FO7KQoYPWhx2h2lrzzUgTn5Ba4IRaFN2KsoWJX6TZP8tTYgS3SVNpOyLL8lk42xct2NzEUcPNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222719; c=relaxed/simple; bh=D3DkjDD6dvOBo/VwPs1BDV3f/nKM+KgJX7LDIFABO4I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=a5+xTMJnu2JoNG9vo3GvSPyANn5RdLQ+o96AltZHkm2+8cGmWeBLZhpwtsIl6VlNpWFtE5Qv8+/Z5S0306J6+saEkRwr0dwh9aGp6I1aO0dB+AbuFFAEf6ac/EIo6MmEjfgDsxP69ZxVEr5ahj9Npm1DlAesFwkdVsxmeqkCBxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H0IJbXyO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H0IJbXyO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D5BFC4CEED; Fri, 15 Aug 2025 01:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222719; bh=D3DkjDD6dvOBo/VwPs1BDV3f/nKM+KgJX7LDIFABO4I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H0IJbXyOUjTEunP36V87uEwlEriSNZgIFWpQ38566b5M7TBfmYgq2IKpc8z9DJ/9Z om1ZV94tV/fHlhD3MYLJ92BN6EhMcXOz43/4CcNOBLC5pnN7YzqyHFj4b8WQSI8A3D W77QRecVcTUgID1jHNoFMvrAAfRWm1h/V19Ia5FKnqF4wzCfWByfHkZVwB4i3j00q8 O/SpQt9zG3NQU+a14WYl6/Ag5/P6c7cG+eYFRckFC52W4IrWsKc2xrycTJLVQk4nIj GCIges9auPegfpkbOwwKVBy5d2b122oB7ME+vnP/P7rGFrL/0h8nPuSKn4cby2kjND 8Sky8rIQwn0Gw== From: Jisheng Zhang To: Ulf Hansson , Aubin Constans , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Manuel Lauss , =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= , Jaehoon Chung , Krzysztof Kozlowski , Alim Akhtar , Heiko Stuebner , Russell King , Chaotian Jing , Matthias Brugger , AngeloGioacchino Del Regno , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Adrian Hunter , Kamal Dasu , Al Cooper , Broadcom internal kernel review list , Florian Fainelli , Haibo Chen , Michal Simek , Eugen Hristev , Vignesh Raghavendra , Ben Dooks , Viresh Kumar , Orson Zhai , Baolin Wang , Chunyan Zhang , Patrice Chotard , Thierry Reding , Jonathan Hunter , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Alexey Charkov Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/38] mmc: sdhci-pxav3: use modern PM macros Date: Fri, 15 Aug 2025 09:33:39 +0800 Message-ID: <20250815013413.28641-5-jszhang@kernel.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250815013413.28641-1-jszhang@kernel.org> References: <20250815013413.28641-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use the modern PM macros for the suspend and resume functions to be automatically dropped by the compiler when CONFIG_PM or CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards. This has the advantage of always compiling these functions in, independently of any Kconfig option. Thanks to that, bugs and other regressions are subsequently easier to catch. Signed-off-by: Jisheng Zhang --- drivers/mmc/host/sdhci-pxav3.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index 1371960e34eb..6fb461cdd904 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c @@ -484,7 +484,6 @@ static void sdhci_pxav3_remove(struct platform_device *pdev) clk_disable_unprepare(pxa->clk_core); } -#ifdef CONFIG_PM_SLEEP static int sdhci_pxav3_suspend(struct device *dev) { int ret; @@ -510,9 +509,7 @@ static int sdhci_pxav3_resume(struct device *dev) return ret; } -#endif -#ifdef CONFIG_PM static int sdhci_pxav3_runtime_suspend(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); @@ -544,12 +541,10 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) sdhci_runtime_resume_host(host, 0); return 0; } -#endif static const struct dev_pm_ops sdhci_pxav3_pmops = { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_pxav3_suspend, sdhci_pxav3_resume) - SET_RUNTIME_PM_OPS(sdhci_pxav3_runtime_suspend, - sdhci_pxav3_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(sdhci_pxav3_suspend, sdhci_pxav3_resume) + RUNTIME_PM_OPS(sdhci_pxav3_runtime_suspend, sdhci_pxav3_runtime_resume, NULL) }; static struct platform_driver sdhci_pxav3_driver = { @@ -557,7 +552,7 @@ static struct platform_driver sdhci_pxav3_driver = { .name = "sdhci-pxav3", .probe_type = PROBE_PREFER_ASYNCHRONOUS, .of_match_table = of_match_ptr(sdhci_pxav3_of_match), - .pm = &sdhci_pxav3_pmops, + .pm = pm_ptr(&sdhci_pxav3_pmops), }, .probe = sdhci_pxav3_probe, .remove = sdhci_pxav3_remove, -- 2.50.0