From nobody Sat Oct 4 16:04:37 2025 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 1088F292B4B; Fri, 15 Aug 2025 01:53:05 +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=1755222785; cv=none; b=DVnuZcyZ2OLw5ifclt4JeQ7dKzMfuJWtjVC/ttlPGZvvg5mOLBWyZut+yIDue0kkBKe68BWbB1GmLNgV1lwNtyce7q+zRgiD4aKDKwmVMdX8Dg7Iq59s8cFDpQQZaMeaX302y8znBSMos7OoBPHIjiF99q0Gz/NvbskJceu8jkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222785; c=relaxed/simple; bh=HiZ4XD/u4pJ1wA4ohoDlBJ2++rgCeSH25iXqkb/Id5A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QlFtg8Lx0czivGZiCT4mpF3DigQoZ7sOPl1dbpHjG0JtrADYrvGemAfARfrBZvdRzLF9eA53firawtX0mPfNCehoC1fQTwZX4XawPd3eQTmvPEQ4MTVuQqZ74NwjwXM0JOjsk8Oa5sgxsGDZto5NbUC9YuvIp/6t3Kb/fycD6wg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mA/JLl3j; 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="mA/JLl3j" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE42BC4CEED; Fri, 15 Aug 2025 01:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222784; bh=HiZ4XD/u4pJ1wA4ohoDlBJ2++rgCeSH25iXqkb/Id5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mA/JLl3jVe71FvL6nc4NXj8fauG7h72JzOotjKYUik6oH6R05zibT0D1auS9aM0k7 aMxLQg5z2OKC1iVwDuFL/yjN9sbVkxgRsRB6EnQp0j/tkTftdpPXwPG5sKMdTwgbbA Dbh7q8yuTH4XNvkdQymNRJkcfowgbpe+jp1N2qQs8LILnk17shBwUWk5N2y3Mwbfa6 002yKhUdZsnoJ1e4Zu7uxJ1UCPIQja+pMtBbfqJ+Yj4AEWPE4ec0NZq95IEhTVLlqO IBdJGF8F8iLXKcqszht9xp+yme6KWTxerAMlH+vTeMDZkuX/nmc+8YIx3KBGzTioS9 TnAZxMAot3ggA== 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 13/38] mmc: omap_hsmmc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:48 +0800 Message-ID: <20250815013413.28641-14-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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/omap_hsmmc.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index adc0d0b6ae37..09e4354d1f1d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -620,8 +620,6 @@ static void omap_hsmmc_set_bus_mode(struct omap_hsmmc_h= ost *host) OMAP_HSMMC_WRITE(host->base, CON, con & ~OD); } =20 -#ifdef CONFIG_PM - /* * Restore the MMC host context, if it was lost as result of a * power state change. @@ -689,6 +687,7 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc= _host *host) return 0; } =20 +#ifdef CONFIG_PM /* * Save the MMC host context (store the number of power state changes so f= ar). */ @@ -1990,7 +1989,6 @@ static void omap_hsmmc_remove(struct platform_device = *pdev) clk_disable_unprepare(host->dbclk); } =20 -#ifdef CONFIG_PM_SLEEP static int omap_hsmmc_suspend(struct device *dev) { struct omap_hsmmc_host *host =3D dev_get_drvdata(dev); @@ -2032,9 +2030,7 @@ static int omap_hsmmc_resume(struct device *dev) pm_runtime_put_autosuspend(host->dev); return 0; } -#endif =20 -#ifdef CONFIG_PM static int omap_hsmmc_runtime_suspend(struct device *dev) { struct omap_hsmmc_host *host; @@ -2102,11 +2098,10 @@ static int omap_hsmmc_runtime_resume(struct device = *dev) spin_unlock_irqrestore(&host->irq_lock, flags); return 0; } -#endif =20 static const struct dev_pm_ops omap_hsmmc_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume) - SET_RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume,= NULL) + SYSTEM_SLEEP_PM_OPS(omap_hsmmc_suspend, omap_hsmmc_resume) + RUNTIME_PM_OPS(omap_hsmmc_runtime_suspend, omap_hsmmc_runtime_resume, NUL= L) }; =20 static struct platform_driver omap_hsmmc_driver =3D { @@ -2115,7 +2110,7 @@ static struct platform_driver omap_hsmmc_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &omap_hsmmc_dev_pm_ops, + .pm =3D pm_ptr(&omap_hsmmc_dev_pm_ops), .of_match_table =3D of_match_ptr(omap_mmc_of_match), }, }; --=20 2.50.0