From nobody Sat Oct 4 14:32:49 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 469BD126BF1; Fri, 15 Aug 2025 01:51:37 +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=1755222697; cv=none; b=Yw2KiCHUhLcpTfy/Q6SUKC7jKvkf+g+VO4mLaJ8IWRLlsB6e6j/Jr1AXmeFmLercWc8Ea1DEbXKOaIacmTNIZ9BBOX+lhEhqBaKxtobSpn4S8WIY4DUFeiGgWvuMiboeBYMXBdeNE6aWmp74GFYjeaIH2b/UobXhUcnK/UYpy2g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222697; c=relaxed/simple; bh=8xKVhyGS8jiY1CWvQdpglzWFsCjq0Bxftl0YAxiHpa0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eKz2NSX4heQM6PKiomh8Wd5sdPyaoC9h8p1b4A8seNWpChuGpc2oSz1kWhh1YJnUa7AWNcb7aeqaNgiWG4YBSMKxBgAsNXjDhVe94zJEoC++3UyttohwS61xAQA6t2lRWmugzIQ+QqkNSMcHEobrsSdOuYzkzoKo5Nj0vgmKCI0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tTW5noZs; 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="tTW5noZs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E521C4CEF6; Fri, 15 Aug 2025 01:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222697; bh=8xKVhyGS8jiY1CWvQdpglzWFsCjq0Bxftl0YAxiHpa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tTW5noZsOjqeIGheWEuVCO0N3Rh5dC1qRU5EQSsi5U4tk+wyr3xlxEdlphZmHbpj2 wlLH5OV0vGtNR5cTyXDs6+pqyr6EXJ2N+Gn0CEg3ugxjmqP5dsPTl1ONj6w3XNhiFq uLkavaS/H2o8hkkz6wuF6o0c33WNEeUcKPzCIM1VVofZULLz+7r9pLYC2omyNmO+ez YIMWAJ60y1GDMYw2Mn02hWtQJOFw5PVnOAlz1+KGD+PKk3JWpXZgE78yH4fE5sJBD0 HljFOfjHh1+dScnTyVdFYpJPTMtSxu3k1COB6tudPbWRTmR0vlfZL7cM9og2M3L3NM rRdfPuHSVWgvQ== 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 01/38] sdhci: add some simple inline functions for !CONFIG_PM Date: Fri, 15 Aug 2025 09:33:36 +0800 Message-ID: <20250815013413.28641-2-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" In next commits, we will switch to the modern PM macros. Signed-off-by: Jisheng Zhang Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 58fcbeaf281e..5b699af04bfe 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -880,6 +880,13 @@ int sdhci_suspend_host(struct sdhci_host *host); int sdhci_resume_host(struct sdhci_host *host); void sdhci_runtime_suspend_host(struct sdhci_host *host); void sdhci_runtime_resume_host(struct sdhci_host *host, int soft_reset); +#else +static inline bool sdhci_enable_irq_wakeups(struct sdhci_host *host) { ret= urn false; } +static inline void sdhci_disable_irq_wakeups(struct sdhci_host *host) {} +static inline int sdhci_suspend_host(struct sdhci_host *host) { return -EO= PNOTSUPP; } +static inline int sdhci_resume_host(struct sdhci_host *host) { return -EOP= NOTSUPP; } +static inline void sdhci_runtime_suspend_host(struct sdhci_host *host) {} +static inline void sdhci_runtime_resume_host(struct sdhci_host *host, int = soft_reset) {} #endif =20 void sdhci_cqe_enable(struct mmc_host *mmc); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 907C3292B44; Fri, 15 Aug 2025 01:51:44 +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=1755222704; cv=none; b=bUegAg0lpVKEXGW+zwrVxwf1Tqk1P+LrA56fEhSMfjdV4zzUfCXSpX3kQGzc/jE6pu+SKu+Vx2qeZ0hWVcRJ7w3c45SRWo80oaD5DRETzdPgYA4f85EQaAAuikyCfkRsmhaoSbBJbYB67pMwESJT2jKGE5asdsZL6lQ382Ov0mM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222704; c=relaxed/simple; bh=qzpM1XuJhY79b5vm7aQ2AzS3RoIhsSh8ykJUmXGcMPc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CU0nOo52vOmQhJyeisM66DuvMDRdYVpH/Kz1EMMcN4rFHn70Hbp1hu4o6kNuoEmwd/UKyZOvhIL+1KVdfstA0hc2Iv9XwW88M3t+XtK5AKc3I4GQGVmtuWGR68p2glwHHuReslaKL1qosssgnSPOVQssSr3bYap4w0XUMWZzvq8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Stakwimz; 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="Stakwimz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A9D7C4CEF1; Fri, 15 Aug 2025 01:51:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222704; bh=qzpM1XuJhY79b5vm7aQ2AzS3RoIhsSh8ykJUmXGcMPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Stakwimz9E9Xy8tXWPKwm3hkGyVw5iyWxs4ffgTN9NRgzMUkT2ABqbGXXsDMW2yWk 3Da4EJaN2vjUKvaSKKsmUd3hol/fZrG9DtUjgXB15dSqLx4FhccUz+3Ga7GJwOHJ+m PKJdTRAZ7E7z7c+vztl6XlAtImwlWsVd4qSEj7oct7P62geVoBevnxl4Wb4qXcdx+3 SSb+kASiI4vazjVuAiF2rYRrukH1yqmfjyLNY5Z+j1/+KsJbxc4zoEkc7mW9Q+57rg 2DN97HZ/IDMhhCCWkWlaCk64MiIIWZP1NOjvd+Vvr/wjJcxtdyVK1kBSFqczqGhor9 bUSvGRvwEMXCQ== 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 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:37 +0800 Message-ID: <20250815013413.28641-3-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 Tested-by: Drew Fustini # for TH1520 on LPi4a --- drivers/mmc/host/sdhci-of-dwcmshc.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-dwcmshc.c b/drivers/mmc/host/sdhci-o= f-dwcmshc.c index ee6b1096f709..eebd45389956 100644 --- a/drivers/mmc/host/sdhci-of-dwcmshc.c +++ b/drivers/mmc/host/sdhci-of-dwcmshc.c @@ -1499,7 +1499,6 @@ static void dwcmshc_remove(struct platform_device *pd= ev) clk_bulk_disable_unprepare(priv->num_other_clks, priv->other_clks); } =20 -#ifdef CONFIG_PM_SLEEP static int dwcmshc_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -1570,9 +1569,6 @@ static int dwcmshc_resume(struct device *dev) clk_disable_unprepare(pltfm_host->clk); return ret; } -#endif - -#ifdef CONFIG_PM =20 static void dwcmshc_enable_card_clk(struct sdhci_host *host) { @@ -1603,12 +1599,9 @@ static int dwcmshc_runtime_resume(struct device *dev) return 0; } =20 -#endif - static const struct dev_pm_ops dwcmshc_pmops =3D { - SET_SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume) - SET_RUNTIME_PM_OPS(dwcmshc_runtime_suspend, - dwcmshc_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(dwcmshc_suspend, dwcmshc_resume) + RUNTIME_PM_OPS(dwcmshc_runtime_suspend, dwcmshc_runtime_resume, NULL) }; =20 static struct platform_driver sdhci_dwcmshc_driver =3D { @@ -1617,7 +1610,7 @@ static struct platform_driver sdhci_dwcmshc_driver = =3D { .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_dwcmshc_dt_ids, .acpi_match_table =3D ACPI_PTR(sdhci_dwcmshc_acpi_ids), - .pm =3D &dwcmshc_pmops, + .pm =3D pm_ptr(&dwcmshc_pmops), }, .probe =3D dwcmshc_probe, .remove =3D dwcmshc_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 3CA6E28750F; Fri, 15 Aug 2025 01:51:51 +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=1755222712; cv=none; b=KKew8064SsWE0HR8uQB9U7Rx6vFI1dZuyPmyGvXHKCrSx/9Adrnb7lIiOyJ8tcmcd9wri9zbNgncVprNPgKTLmIUtUr9C+jldu4iuz72jZeMNIx/7ff8W3Eoawgw+NmPTpb6i8Nhv+WLXlRZgdocIvVlP3SlAHonacMgi0FdZP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222712; c=relaxed/simple; bh=Dj5pUa6pYGCNddPS96diLSsPZ688CWM7lpn6XfJEyN8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F4QNtfkOMyXkCeNMefUEZcD1jIWNhIrmnjZW0GovtpEi7aOvVF7tzoKzBMFjz8NQ1z8fNQqceN+E0jhLbExiIQIwnUwHnmYCl6YymmeaPaUtmnxMsDE/HRkIQSELP5LtR1f7+1OUb7Pn+XjlrWIe30keexLYF1jYV6Q3L/IkSW8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LUqdTHUJ; 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="LUqdTHUJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D63BEC4CEF6; Fri, 15 Aug 2025 01:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222711; bh=Dj5pUa6pYGCNddPS96diLSsPZ688CWM7lpn6XfJEyN8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LUqdTHUJP84cKaciSc+feda3XjCat/0sQjwYdBs9YejAxI6VCKODbud3cJj1KuwML sBf9y11YnuiPs6NWgmH60SIO2gIBirpueH6bIJ2qIoIvfKjf25DPO6yVjO2dll9W7G qje0NgLnbvNPyU1oWWj0dXDcOKUuScsd5pPbYYcKYJF806ygFqxA1KOh08myodIPru q+tVch4xac3CswRUOoTfGlxxC5XK+Gm8zSGZa0+Ka/FZSKtOlMPlQzqG0pnCx0PQ8x xDFMZ9AVgV64qqQI6hW9RMXUXsxFGf4Amx2wCpdazKX4nMep0T966wor3JGXAdpRIa Z3AS/U7TtylUw== 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 03/38] mmc: sdhci-xenon: use modern PM macros Date: Fri, 15 Aug 2025 09:33:38 +0800 Message-ID: <20250815013413.28641-4-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/sdhci-xenon.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-xenon.c b/drivers/mmc/host/sdhci-xenon.c index b12bee8342bd..046e8100dd08 100644 --- a/drivers/mmc/host/sdhci-xenon.c +++ b/drivers/mmc/host/sdhci-xenon.c @@ -622,7 +622,6 @@ static void xenon_remove(struct platform_device *pdev) clk_disable_unprepare(pltfm_host->clk); } =20 -#ifdef CONFIG_PM_SLEEP static int xenon_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -635,9 +634,7 @@ static int xenon_suspend(struct device *dev) priv->restore_needed =3D true; return ret; } -#endif =20 -#ifdef CONFIG_PM static int xenon_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -685,14 +682,10 @@ static int xenon_runtime_resume(struct device *dev) clk_disable_unprepare(pltfm_host->clk); return ret; } -#endif /* CONFIG_PM */ =20 static const struct dev_pm_ops sdhci_xenon_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(xenon_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(xenon_runtime_suspend, - xenon_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(xenon_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(xenon_runtime_suspend, xenon_runtime_resume, NULL) }; =20 static const struct of_device_id sdhci_xenon_dt_ids[] =3D { @@ -721,7 +714,7 @@ static struct platform_driver sdhci_xenon_driver =3D { .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_xenon_dt_ids, .acpi_match_table =3D ACPI_PTR(sdhci_xenon_acpi_ids), - .pm =3D &sdhci_xenon_dev_pm_ops, + .pm =3D pm_ptr(&sdhci_xenon_dev_pm_ops), }, .probe =3D xenon_probe, .remove =3D xenon_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 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: 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/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); } =20 -#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) =20 return ret; } -#endif =20 -#ifdef CONFIG_PM static int sdhci_pxav3_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D 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 =20 static const struct dev_pm_ops sdhci_pxav3_pmops =3D { - 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, N= ULL) }; =20 static struct platform_driver sdhci_pxav3_driver =3D { @@ -557,7 +552,7 @@ static struct platform_driver sdhci_pxav3_driver =3D { .name =3D "sdhci-pxav3", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D of_match_ptr(sdhci_pxav3_of_match), - .pm =3D &sdhci_pxav3_pmops, + .pm =3D pm_ptr(&sdhci_pxav3_pmops), }, .probe =3D sdhci_pxav3_probe, .remove =3D sdhci_pxav3_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 D1261293B4C; Fri, 15 Aug 2025 01:52:06 +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=1755222726; cv=none; b=X2pB5Tuv/G5h01slQ50yJ/u/I18GhSDCnA87XBhqgQKHxQaEn7BgJHe///aM4ymtQWQ3V+qIt69mDGmKGojKHQPrGIp2Dd1uIQ9T/xBSJ1rBm3EFuJ3GQePQWQZf5DF92XclY0zZ9dtKkscfTW9+SJl/3TimNXE5IoYpU7Pzsvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222726; c=relaxed/simple; bh=pR5SwC3YqQIvXXY6dZ+NTJY284WdtppxcrZ3YVoccdE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A7l9UbK+saIBOxG8Sz4aXH1T15fMvbcMRDLXJL/iIwRs1JeqaI8zDX35WYZ58OwmyA83ibpQQOQzNZYRzrjcE++E5tWmKJx13IWWiffobPeuyYjiffYAFDvgKzA5mkYP3voYN7ppkKj8+Rf3ykw9pl05rWnyc0jPaEmwRrM9N4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pu4ELYqX; 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="pu4ELYqX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 771CEC4CEF7; Fri, 15 Aug 2025 01:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222726; bh=pR5SwC3YqQIvXXY6dZ+NTJY284WdtppxcrZ3YVoccdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pu4ELYqXeLtckNlivIlNoh7OfZvmgIovYIbDUYyTNI6PxUeFTqMANm16xB5RXrURL EIlCrwtOm8QcmnoJ+1MrgQ7XN/MZpwuBPP3JB5DZfFUyIa6z1dZdaYuwz3KsCCVwCo X3MSGWG7SfsjPjvwu5IZjUePu37rhOB5ryrWMFyqBjTRHIIK3j0y0Qh+PvIAt+hWfi fDWlEvEEJPw/WQgUdH7lAYj9/kyOI4g4woiCJhzDBzx6iGYQewaiF8UA1VLGy80E18 FZ9naUqHrHdEoGoNnrwjIZOvQOshHTpSzgHNTi5cBkwaS0+Y/XdCisIWY5k2yq/tMy HZi3vjmNo+49Q== 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 05/38] mmc: sunxi: use modern PM macros Date: Fri, 15 Aug 2025 09:33:40 +0800 Message-ID: <20250815013413.28641-6-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/sunxi-mmc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index ee4a65b0a22d..8dbcff53a631 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1495,7 +1495,6 @@ static void sunxi_mmc_remove(struct platform_device *= pdev) dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); } =20 -#ifdef CONFIG_PM static int sunxi_mmc_runtime_resume(struct device *dev) { struct mmc_host *mmc =3D dev_get_drvdata(dev); @@ -1530,14 +1529,10 @@ static int sunxi_mmc_runtime_suspend(struct device = *dev) =20 return 0; } -#endif =20 static const struct dev_pm_ops sunxi_mmc_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, - sunxi_mmc_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(sunxi_mmc_runtime_suspend, sunxi_mmc_runtime_resume, NULL) }; =20 static struct platform_driver sunxi_mmc_driver =3D { @@ -1545,7 +1540,7 @@ static struct platform_driver sunxi_mmc_driver =3D { .name =3D "sunxi-mmc", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sunxi_mmc_of_match, - .pm =3D &sunxi_mmc_pm_ops, + .pm =3D pm_ptr(&sunxi_mmc_pm_ops), }, .probe =3D sunxi_mmc_probe, .remove =3D sunxi_mmc_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 27646126BF1; Fri, 15 Aug 2025 01:52:13 +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=1755222735; cv=none; b=j44DxRTpFfqL4LAeO84N4y/V8rv9+qx5B+9MfR+aN+xMnV6UHR8ifqPtggCjgoGgxXmqaL654w5O6hOmfFODa1XIlbZz0ZGpBGt+2T3ENyh/9cfFT3ur+QJ/9gjzz0YLPlMtNkOGSbzRI5V8Rt8VCi0kkgvG33ToBGPuc+zs7LU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222735; c=relaxed/simple; bh=uZES36OWOSTbBmVBY5IvFFyIvgQpeCcxTZIxV8x7MY4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jVpQLB+yw8gJw4C7+rOoci+hH8L43MIH3aPSGX3oshKxAm51aRf1oj9eheMlUIEoL/OE7AcYu4qssdNHwicj3OpV1PRShSsTcYrIjAQzoXxDu+ICulAUhNBpnFscUtCrt61hZncq7UVcS5UY8atE6wKNQbGmIgv86YaOz6Wq3mE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P8/KEHKH; 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="P8/KEHKH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4AF9C4CEED; Fri, 15 Aug 2025 01:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222733; bh=uZES36OWOSTbBmVBY5IvFFyIvgQpeCcxTZIxV8x7MY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P8/KEHKHOHp7taVdgWlB+Nc7+OFP3UQCssF41Qa86sL3PDQmehvB04bBJW83nVcGF EpscYyRroa2rmRckpsd8x7WBe73edFctEkd+sZ8twG42jXuJye31ItAoJhCUhON9f8 2rSphfbSopT78Xr0qMZPRleg12CxeBfRqRVAlQLmPSOI/NJC15878v9lzAx1Homh7w qcfCRBYcQ7H7SpUKuJd5YgFhhFLLo+BmeX1o2B4QxfcmhHasoapc8Zhbsz8pYx8Wcz GSrVJg4MC1xmeuWwLgmF1nK/WId4O4LJWBdxFjF+3Fi3d2pLvYngpKH6YdE499yVlq Sb6xBDKrxB3LQ== 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 06/38] mmc: alcor: use modern PM macros Date: Fri, 15 Aug 2025 09:33:41 +0800 Message-ID: <20250815013413.28641-7-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/alcor.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c index 288c3a91a0af..721db54739c1 100644 --- a/drivers/mmc/host/alcor.c +++ b/drivers/mmc/host/alcor.c @@ -1129,7 +1129,6 @@ static void alcor_pci_sdmmc_drv_remove(struct platfor= m_device *pdev) mmc_remove_host(mmc); } =20 -#ifdef CONFIG_PM_SLEEP static int alcor_pci_sdmmc_suspend(struct device *dev) { struct alcor_sdmmc_host *host =3D dev_get_drvdata(dev); @@ -1150,10 +1149,9 @@ static int alcor_pci_sdmmc_resume(struct device *dev) =20 return 0; } -#endif /* CONFIG_PM_SLEEP */ =20 -static SIMPLE_DEV_PM_OPS(alcor_mmc_pm_ops, alcor_pci_sdmmc_suspend, - alcor_pci_sdmmc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(alcor_mmc_pm_ops, alcor_pci_sdmmc_suspend, + alcor_pci_sdmmc_resume); =20 static const struct platform_device_id alcor_pci_sdmmc_ids[] =3D { { @@ -1171,7 +1169,7 @@ static struct platform_driver alcor_pci_sdmmc_driver = =3D { .driver =3D { .name =3D DRV_NAME_ALCOR_PCI_SDMMC, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &alcor_mmc_pm_ops + .pm =3D pm_sleep_ptr(&alcor_mmc_pm_ops), }, }; module_platform_driver(alcor_pci_sdmmc_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 6430B126BF1; Fri, 15 Aug 2025 01:52:21 +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=1755222741; cv=none; b=PVxFGlyFWZbELpimx89HbQ753TSODGYePtzezgDg2ijHGaXGfnQf1VkhgMVeG+NpOomOoDMZilQ0edC22HEX/dROE18F6QipwtB/Wsi+XqItrAcXYR1XDG2EMcRvXzAY6Cpu28830m4e5vK3fwVLdMa5xp4CQJf/23aHdGQB5t4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222741; c=relaxed/simple; bh=iX7IOVbBU0iKfkEMkyGcPNaVsUqvqC0gaZQA5pKhNR8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uQg3FL/G9ysAcaMSHtgV3zsHfqI7hyhyPAZvKWN49QpAOJd+f+BwS/gyMFlIc7IvvFGvQ/JGCD4WyDR2iXC0lvwf/iftfabx7fI8fTpSZYaasRS9jRiTVAdk+zPr1sIiSMKjzVllJknjki9VD5fe68wmuEwCubFSrimzYuRUTZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AhAHFOi/; 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="AhAHFOi/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C205C4CEF5; Fri, 15 Aug 2025 01:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222741; bh=iX7IOVbBU0iKfkEMkyGcPNaVsUqvqC0gaZQA5pKhNR8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhAHFOi/JlN87VrzcWaGUozNfWkDJ/evavNiYQNbE1+UqRLAQC4ERMcyZNHsaPrhF yA8NnN7BKDDIhAjJ5BJATZQViwfu0wWgUO6Y0p1tWVCaIybdYTJgxz4RT5ns5YHIZg 3Ncy76LbVq+yVkmKj3bRlM5ih5HxE8GfWYUHDMj6lL7F3Lawno/YiqQ6vQGbs5qefH xUD+fKizHRSz2sSsX+tsv23T/ByY1g/eBbRRprkWevHZxKnhazMrdiUrPIGgC0llzv n8iJZfEyvrxIdbPBsAcAKCFNfZ3O8e5JAkZbzqm6XNRdslQpACgET0eyg4Mw/DqtSW xAFYTdEN5rH+w== 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 07/38] mmc: atmel: use modern PM macros Date: Fri, 15 Aug 2025 09:33:42 +0800 Message-ID: <20250815013413.28641-8-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/atmel-mci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 777342fb7657..d1fbc6811563 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -2622,7 +2622,6 @@ static void atmci_remove(struct platform_device *pdev) pm_runtime_put_noidle(dev); } =20 -#ifdef CONFIG_PM static int atmci_runtime_suspend(struct device *dev) { struct atmel_mci *host =3D dev_get_drvdata(dev); @@ -2642,12 +2641,10 @@ static int atmci_runtime_resume(struct device *dev) =20 return clk_prepare_enable(host->mck); } -#endif =20 static const struct dev_pm_ops atmci_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(atmci_runtime_suspend, atmci_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(atmci_runtime_suspend, atmci_runtime_resume, NULL) }; =20 static struct platform_driver atmci_driver =3D { @@ -2657,7 +2654,7 @@ static struct platform_driver atmci_driver =3D { .name =3D "atmel_mci", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D atmci_dt_ids, - .pm =3D &atmci_dev_pm_ops, + .pm =3D pm_ptr(&atmci_dev_pm_ops), }, }; module_platform_driver(atmci_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 C4883295516; Fri, 15 Aug 2025 01:52:28 +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=1755222748; cv=none; b=iFEpzTqja0Xm84HiO4/2BLEA3YKDwGsalZsoyp697CuPUHTqMoVVYF0ThoqFJWYn07qeCCVoVI9Tcr6ekf1/AFLq3LJgXolBrz19zrMaTkKqOoFh5XlH1Y3voIDFLQs4YQTzOnxjy0x5AVft1akf1eXLLp4Aki8bvtnxkNaES9Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222748; c=relaxed/simple; bh=4sxfAvqj4cNcTFAG8eOyEmLc1goXUm05coglsT+wLRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQTIvy3lnQrLSGcGnwPRX8hAR0lO4R5ognM7M6pA8G37iqA5EMh9zEUH1xlxA0NZpJklLQbd2f1uqynqbVg1N9mYQF2BRbA+SqXV2s5mEkZNjTzXhR/5ActttqEHCz7iaeR0qa2Q8uvQf0dCisosKRxxI4NZhxqFZYREoU2DBSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mHIOCE+q; 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="mHIOCE+q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 663EEC4CEF1; Fri, 15 Aug 2025 01:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222748; bh=4sxfAvqj4cNcTFAG8eOyEmLc1goXUm05coglsT+wLRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mHIOCE+qM9QODXAdFTgwu9zEZ1YLlNbM6c7GXih3Rfm+YABbaNO6OgHhkY7vjKSMb 2MTMEFE+Q/+nrg5Xb0pdIReB2f7E029ylWaelUEjE78ErOwT59th9Cu5spLXPH1/CP hWrnQ0f0WSc82Xwmuisgz0gXiRH8wdrdTn/ZbeoL3gjqA5eDl8GQpt79UVzurkMPyx ogXT2PB4wGOh8IXuTkZcHE6tTCheIYS8YmxZylWh3EGCBABghcjXmJVwIMTo2MTLSX TpA0t8Q+NdUB3YmmiF81LpBzMOE7u+hkJYqQEqFWBrab7BaHjBlbmy+XHt+Du1waTR 2BSOlkEEs0PBA== 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 08/38] mmc: au1xmmc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:43 +0800 Message-ID: <20250815013413.28641-9-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. At the same time, replace the platform_driver's .suspend and .resume usage with modern device_driver's .pm usage. Signed-off-by: Jisheng Zhang --- drivers/mmc/host/au1xmmc.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c index 85470773650d..cc6e05f9b96f 100644 --- a/drivers/mmc/host/au1xmmc.c +++ b/drivers/mmc/host/au1xmmc.c @@ -1150,10 +1150,9 @@ static void au1xmmc_remove(struct platform_device *p= dev) } } =20 -#ifdef CONFIG_PM -static int au1xmmc_suspend(struct platform_device *pdev, pm_message_t stat= e) +static int au1xmmc_suspend(struct device *dev) { - struct au1xmmc_host *host =3D platform_get_drvdata(pdev); + struct au1xmmc_host *host =3D dev_get_drvdata(dev); =20 __raw_writel(0, HOST_CONFIG2(host)); __raw_writel(0, HOST_CONFIG(host)); @@ -1164,27 +1163,24 @@ static int au1xmmc_suspend(struct platform_device *= pdev, pm_message_t state) return 0; } =20 -static int au1xmmc_resume(struct platform_device *pdev) +static int au1xmmc_resume(struct device *dev) { - struct au1xmmc_host *host =3D platform_get_drvdata(pdev); + struct au1xmmc_host *host =3D dev_get_drvdata(dev); =20 au1xmmc_reset_controller(host); =20 return 0; } -#else -#define au1xmmc_suspend NULL -#define au1xmmc_resume NULL -#endif + +static DEFINE_SIMPLE_DEV_PM_OPS(au1xmmc_pmops, au1xmmc_suspend, au1xmmc_re= sume); =20 static struct platform_driver au1xmmc_driver =3D { .probe =3D au1xmmc_probe, .remove =3D au1xmmc_remove, - .suspend =3D au1xmmc_suspend, - .resume =3D au1xmmc_resume, .driver =3D { .name =3D DRIVER_NAME, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, + .pm =3D pm_sleep_ptr(&au1xmmc_pmops), }, }; =20 --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 127D029344F; Fri, 15 Aug 2025 01:52:35 +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=1755222756; cv=none; b=VdL3U0iz9wCqd/kgSPAoru7E+sB2b1uNjIMygqPOMTHMbI9TPwrfhH67YW4cwmAMOe8Anrm/s/Hrd0aLvuLG4ZkYciD5KDAyCCd+rkCUBzrXsXkF00oGkE8ksr0B30ESbep0pd3Mp0YcfBiXEOHLrstqpUTX0wnwSTFAC+78PQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222756; c=relaxed/simple; bh=msCcAvgmi8cjejj/bvx4fWv7p7OoguqU+iU6TDTArRk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CZOMZGmqqKiVIWhFsmHof2T42tivoZLRliargCVL4W1bdJE3vFVC6kYooKTllyknzUl6blqWgzOkQHpJLWW1p0jbkmpNZhl7usUfTIsuyhcqn34zw+0llEI3nJY4UUNKezSmO9OvNHBP+t4f7jzZkGZOnaMFzNQViyWLuYdJYAA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eYxY7vtX; 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="eYxY7vtX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B00A4C4CEF6; Fri, 15 Aug 2025 01:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222755; bh=msCcAvgmi8cjejj/bvx4fWv7p7OoguqU+iU6TDTArRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eYxY7vtXqaX7YJcy1zJf9xAbJ4YA8B/F9s+Jp/+ua09WP7sEEyT4gPGoQityJgjO1 5xl4NBpSYzvNWJqxWajYQuhj7Loh+pJ/t9w3vB2AeD0XTjU4z0EOg76TAkHGxeZOpX 8Lhge4A3seUB0oBTgGkg+voVTZmSKUiTeLOk+9KuQIyd4BzMqeeo3LELi68pUpqDFe bArbj5zBXda5yCGXaCVLCyXIRzeCeDJlgF56dc8m3ES63b6gO4gbP8LTxvPCABgiyt zr7o3scbcxG2BwonXW9w2Mq1oD31nTtgnG7hXKGEXOgpuBsb3npikS2ZWwWNkQ7LyV URp6OO0DhF6Lg== 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 09/38] mmc: cb710-mmc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:44 +0800 Message-ID: <20250815013413.28641-10-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. At the same time, replace the platform_driver's .suspend and .resume usage with modern device_driver's .pm usage. Signed-off-by: Jisheng Zhang Acked-by: Micha=C5=82 Miros=C5=82aw --- drivers/mmc/host/cb710-mmc.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/cb710-mmc.c b/drivers/mmc/host/cb710-mmc.c index 448d2f9159ea..31daec787495 100644 --- a/drivers/mmc/host/cb710-mmc.c +++ b/drivers/mmc/host/cb710-mmc.c @@ -664,25 +664,25 @@ static const struct mmc_host_ops cb710_mmc_host =3D { .get_cd =3D cb710_mmc_get_cd, }; =20 -#ifdef CONFIG_PM - -static int cb710_mmc_suspend(struct platform_device *pdev, pm_message_t st= ate) +static int cb710_mmc_suspend(struct device *dev) { + struct platform_device *pdev =3D to_platform_device(dev); struct cb710_slot *slot =3D cb710_pdev_to_slot(pdev); =20 cb710_mmc_enable_irq(slot, 0, ~0); return 0; } =20 -static int cb710_mmc_resume(struct platform_device *pdev) +static int cb710_mmc_resume(struct device *dev) { + struct platform_device *pdev =3D to_platform_device(dev); struct cb710_slot *slot =3D cb710_pdev_to_slot(pdev); =20 cb710_mmc_enable_irq(slot, 0, ~0); return 0; } =20 -#endif /* CONFIG_PM */ +static DEFINE_SIMPLE_DEV_PM_OPS(cb710_mmc_pmops, cb710_mmc_suspend, cb710_= mmc_resume); =20 static int cb710_mmc_init(struct platform_device *pdev) { @@ -767,13 +767,12 @@ static void cb710_mmc_exit(struct platform_device *pd= ev) } =20 static struct platform_driver cb710_mmc_driver =3D { - .driver.name =3D "cb710-mmc", + .driver =3D { + .name =3D "cb710-mmc", + .pm =3D pm_sleep_ptr(&cb710_mmc_pmops), + }, .probe =3D cb710_mmc_init, .remove =3D cb710_mmc_exit, -#ifdef CONFIG_PM - .suspend =3D cb710_mmc_suspend, - .resume =3D cb710_mmc_resume, -#endif }; =20 module_platform_driver(cb710_mmc_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 11B22292906; Fri, 15 Aug 2025 01:52:43 +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=1755222763; cv=none; b=gOAt+3V8K+RexmifOZdj8KHqpbEdJf7ZKw9/JiLs9NYBgZtNEzsIUm8QUvwXqivuT/K8+jA7Ft5aK7PZbDg3DYItZQyczDPOwi46F+bSM7ZEgJMMTnxZ4e4jkTzz6Htaw8EAUjz3o2IUXBD8sQLg5dD1cc3p7AVLmg9jxCPKWDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222763; c=relaxed/simple; bh=9RmwzGROqS9ck1Ji2XOxbWPQpMewErkgs9sCdvkpL+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CPfMDdwSoZD6AzXkTDoxyesiW29uDq4FLOM+kmn+X2smn+Q5JJ2SxADGqDyLQMBa2Djd0Y84TXZOHwZ/ynl9QsgNJ+VrN4S7pMpRngJ1z5v06+WYMPk+lj1TLdXDRcADV1f4ZsdDu1XpdtRAwc3ugHRdOe50YBiJkENdEvGy60k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OQFe3H9b; 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="OQFe3H9b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A075C4CEF5; Fri, 15 Aug 2025 01:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222762; bh=9RmwzGROqS9ck1Ji2XOxbWPQpMewErkgs9sCdvkpL+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OQFe3H9bTycS7/s20LwV6tDDKPMfREMWN6QhYX4vqLHzaWUumZETvOoTzvKKDaUqO M1R6ftX7vzOA8mGFV8s9WSLSMrPBVS6ItqipZN/zs8I4WYMfbz94cC7Y5ms8VeQDke tCf0QPCmtubxEblu3zO8YZw5PpSLnj70xON+76530uw7c5iNWX57Eym3yF0B4Q2qJc UvUpXzZKCBZohU/2l9rCm2iK3kHk5WBJMsrLbz1YZZUtNnpwNfMmZgVxwqHrjem29G o5WVgxx+xTA107BvqPfCpCK++XwhtUjzqpkE779qHEbwKWESQ9PbXa3Y0CPH1WrRWn Bpvn6MFF/FJXQ== 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 10/38] mmc: davinci_mmc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:45 +0800 Message-ID: <20250815013413.28641-11-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/davinci_mmc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index c691f1b60395..75fd00fc51ed 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1347,7 +1347,6 @@ static void davinci_mmcsd_remove(struct platform_devi= ce *pdev) clk_disable_unprepare(host->clk); } =20 -#ifdef CONFIG_PM static int davinci_mmcsd_suspend(struct device *dev) { struct mmc_davinci_host *host =3D dev_get_drvdata(dev); @@ -1373,21 +1372,14 @@ static int davinci_mmcsd_resume(struct device *dev) return 0; } =20 -static const struct dev_pm_ops davinci_mmcsd_pm =3D { - .suspend =3D davinci_mmcsd_suspend, - .resume =3D davinci_mmcsd_resume, -}; - -#define davinci_mmcsd_pm_ops (&davinci_mmcsd_pm) -#else -#define davinci_mmcsd_pm_ops NULL -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(davinci_mmcsd_pm_ops, + davinci_mmcsd_suspend, davinci_mmcsd_resume); =20 static struct platform_driver davinci_mmcsd_driver =3D { .driver =3D { .name =3D "davinci_mmc", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D davinci_mmcsd_pm_ops, + .pm =3D pm_sleep_ptr(&davinci_mmcsd_pm_ops), .of_match_table =3D davinci_mmc_dt_ids, }, .probe =3D davinci_mmcsd_probe, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 A792D292906; Fri, 15 Aug 2025 01:52:50 +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=1755222770; cv=none; b=rlE234gWrys2HLo8idJsUz4ldfHvLgfAH+VkJKCphkSvM1fheozIxKnVAFdO31a5fiCNUPdhcU4CcjSPzC+RbiLEuYx+lo9IHe8Pn3B7x2A9bQI7OZEsXrOpLKLbhzBhrpKpwijrRZh/S7yeDUzvOfcVHdlMD92Iw8KCrc+/oco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222770; c=relaxed/simple; bh=IzZgrP+Thm8aY8QaBcmn+pxhfIUSwm9lvX5B3/yxCjw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OKQpY1u0D+GKwZrWoPON97PgVmJRKq8XV6KgsCLv++v35p9lYLukTUpUzO0ESh+xXdU/v4PcV10cWZfJSDwMGKhd6O6blWfsNiBCKM4xw8xDqVUkaommVe0Z/qgHt8PAU0POOKMW7lf4l9M+bGyNJybFBS7oG3/Wk2G+LmBFA5s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kAY78ScT; 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="kAY78ScT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56219C4CEED; Fri, 15 Aug 2025 01:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222770; bh=IzZgrP+Thm8aY8QaBcmn+pxhfIUSwm9lvX5B3/yxCjw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kAY78ScTm7Jba7wSMqJrIh+m8CrW6Xn3mPma7xXWtD8mzaKvMaZFxZ1Dl/BdUD414 bAmErURaLsJQtX2aHHlgVOwrSth8aQMDnNtcISUJ4t0kdP54Jb8Iu3xbPHpgWZCCvt B9R+mTvxNgwNbcYuQ9NlZiOpm29jEqq4Z5XFDcqjhT/ur7sdd2Et99/y1IG4gVWIDD cdt5kk1WWERYQF4/Buj0q4SNUQOgcYrtx2AkFNdm9mYxMHRt0noIzbecahW1XQcB88 NjDOc2eYroTQ2CJluGJC/rgJqHInz+t3BzWa/AbJTacJobQ+qtxxJhcqCbA4Vgj+6y yZg/+SeNRwfKg== 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 11/38] mmc: mmci: use modern PM macros Date: Fri, 15 Aug 2025 09:33:46 +0800 Message-ID: <20250815013413.28641-12-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/mmci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 8367283647a9..e500051bd572 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -2516,7 +2516,6 @@ static void mmci_remove(struct amba_device *dev) } } =20 -#ifdef CONFIG_PM static void mmci_save(struct mmci_host *host) { unsigned long flags; @@ -2581,12 +2580,10 @@ static int mmci_runtime_resume(struct device *dev) =20 return 0; } -#endif =20 static const struct dev_pm_ops mmci_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(mmci_runtime_suspend, mmci_runtime_resume, NULL) }; =20 static const struct amba_id mmci_ids[] =3D { @@ -2675,7 +2672,7 @@ MODULE_DEVICE_TABLE(amba, mmci_ids); static struct amba_driver mmci_driver =3D { .drv =3D { .name =3D DRIVER_NAME, - .pm =3D &mmci_dev_pm_ops, + .pm =3D pm_ptr(&mmci_dev_pm_ops), .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, }, .probe =3D mmci_probe, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 EEF86292B4B; Fri, 15 Aug 2025 01:52:57 +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=1755222778; cv=none; b=uAC1lBxagIelztoKzgZiqJS35Q99rdTc9vXcpsSNC9vhOu5lgJMX4i1cexMt85diwgHdFXttbOtpyX7H92iCCajDa+CergjlLmTZAZMXV0Dm6DBh/KHoDjrqF4Qfdkkd4cRTFwSBZA0ijS0xsp8mgC2X79Ko3R9jUFRVHsxncAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222778; c=relaxed/simple; bh=INlG0kmvqymyn+H5Y2Jxgc3TKHlGOcIl3DMuV65cwzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f2+Aqsuh0jhtUJreI6+0tJw1/xnCTcARVo3o4fpC761yFgSsQeXcbmZvtvhs6+aEH59EmsnLsk5SY84u1Igtf7gHdiLyOR1MV9rBDt9COD4Bhn/CvJK4qykuRpiVUju0oj132ryfG3UpVzgdLhJ8fuqXJzR/YEnRGjgUMXADT/4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=A14Vblpk; 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="A14Vblpk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1C69C4CEF1; Fri, 15 Aug 2025 01:52:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222777; bh=INlG0kmvqymyn+H5Y2Jxgc3TKHlGOcIl3DMuV65cwzY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A14Vblpk8k9Atpkx9WpA3Dde2demSaHB2yZO/0mQsaCMmun0f8LeslrhEiMq0/3F8 PqoajhBfFhrvJsBMBLF1P7ULHedL4y2MFD2f+DPCTxSoa5hc07kO6khaXdp1CrVEFO b60JqOU32zhF5vFkpBtwXJtj53rzUpZnvG5Hm7cCMI+jllN6iUxeltHtwKaIOeL627 012abVMeD0JY5e62IUTg7CbGvw0NPaPPPZVY/3xgnZmwO2SwdxITZ0EgqcGy+cjujo DtlzZWuPZnlClsRsftc3dIomXOlfG29IYgZ+WXU4H0trSxqPVY4cdY9Fa01gTN93L7 cNUTWhma3TXsw== 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 12/38] mmc: mxs-mmc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:47 +0800 Message-ID: <20250815013413.28641-13-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/mxs-mmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index a6e44e406106..7c7c52d9e8e7 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c @@ -680,7 +680,6 @@ static void mxs_mmc_remove(struct platform_device *pdev) clk_disable_unprepare(ssp->clk); } =20 -#ifdef CONFIG_PM_SLEEP static int mxs_mmc_suspend(struct device *dev) { struct mmc_host *mmc =3D dev_get_drvdata(dev); @@ -699,9 +698,8 @@ static int mxs_mmc_resume(struct device *dev) =20 return clk_prepare_enable(ssp->clk); } -#endif =20 -static SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mxs_mmc_pm_ops, mxs_mmc_suspend, mxs_mmc_r= esume); =20 static struct platform_driver mxs_mmc_driver =3D { .probe =3D mxs_mmc_probe, @@ -709,7 +707,7 @@ static struct platform_driver mxs_mmc_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &mxs_mmc_pm_ops, + .pm =3D pm_sleep_ptr(&mxs_mmc_pm_ops), .of_match_table =3D mxs_mmc_dt_ids, }, }; --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 From nobody Sat Oct 4 14:32:49 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 AA41D27E7E1; Fri, 15 Aug 2025 01:53:12 +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=1755222792; cv=none; b=qetY9CAO8gy0GKTF4fYpHjeP7RGuM9Cdu+i2c6XDHa1fMWSeIG+PPsuOyYL2hKXKGTF3SCnu/ufBmlBBkOrWBWFkUVlLNgEd+ZJBsFltMWuse5LU3JkFECcBjanuwpMtPxonT+b+ilcfT8a1WBzpQnmz7IUrOtyIlyvtwFZHl7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222792; c=relaxed/simple; bh=wNn/Z9vUP6iHRWkf9R1OqTJtEgv9lNTdtSOoH2sgL8g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pvbvnCUCEp6NE1A7euVJN2ofYfOYainZjFHzJC8ffpafRdGGSQAKiZyovv7XgknSszIg3DTtlOMsXm68ma1pfU9KPIZbwPsOLYm/QK/TjmxfzJQBK+Gdis0avIYPf7oyA9C3k8H8U1UQnum1JvQZcdVygqUGMz1xa6T04bpBz5A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iH62QQsC; 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="iH62QQsC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D1BAC4CEF1; Fri, 15 Aug 2025 01:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222792; bh=wNn/Z9vUP6iHRWkf9R1OqTJtEgv9lNTdtSOoH2sgL8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iH62QQsCvnwapvY6vzORU0hWUDL2BjqlSblFzc8s9C4BPyZIz16/oRvO0NmiJFpSq DZqESJwSOhigggBHM7PiO+GF6nsD7pRe9hOEIP/PimOLxzG/L6l1IUJ6ZpCXDP80Oy 5wgdz3kytDQIoBmU5zUNcx+of5tGePAxqZoBrr9V5whthaOdN9WOo6H06+1SK38xUt d0X2iivlQLh5zheCdjltAwa5siXqpo7/Ll/1Rr0pMHFPtqd3zlKxoDKwUisiAf1K2D Zqn/g+K6REWcrhn9VZ7W2MzK3MiDLKzpitaC7RuGOvUag8udEvTsVb1qfXgNK2p9aI OdgtaRwTlToEQ== 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 14/38] mmc: rtsx_usb_sdmmc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:49 +0800 Message-ID: <20250815013413.28641-15-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/rtsx_usb_sdmmc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_= sdmmc.c index c5f6b9df066b..98184b140a41 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1428,7 +1428,6 @@ static void rtsx_usb_sdmmc_drv_remove(struct platform= _device *pdev) ": Realtek USB SD/MMC module has been removed\n"); } =20 -#ifdef CONFIG_PM static int rtsx_usb_sdmmc_runtime_suspend(struct device *dev) { struct rtsx_usb_sdmmc *host =3D dev_get_drvdata(dev); @@ -1446,11 +1445,9 @@ static int rtsx_usb_sdmmc_runtime_resume(struct devi= ce *dev) mmc_detect_change(host->mmc, 0); return 0; } -#endif =20 static const struct dev_pm_ops rtsx_usb_sdmmc_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(rtsx_usb_sdmmc_runtime_suspend, - rtsx_usb_sdmmc_runtime_resume, NULL) + RUNTIME_PM_OPS(rtsx_usb_sdmmc_runtime_suspend, rtsx_usb_sdmmc_runtime_res= ume, NULL) }; =20 static const struct platform_device_id rtsx_usb_sdmmc_ids[] =3D { @@ -1469,7 +1466,7 @@ static struct platform_driver rtsx_usb_sdmmc_driver = =3D { .driver =3D { .name =3D "rtsx_usb_sdmmc", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &rtsx_usb_sdmmc_dev_pm_ops, + .pm =3D pm_ptr(&rtsx_usb_sdmmc_dev_pm_ops), }, }; module_platform_driver(rtsx_usb_sdmmc_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 DAA84293B75; Fri, 15 Aug 2025 01:53:19 +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=1755222799; cv=none; b=aziUfpt5IqwVzr+g/hp0n4TDVnDXZ4TPCV+aaQ7BooGhRjO/mJ9cMkeoCdKwCEEehzicFZqt2keMgfS0T4Nb+3QkKc0FJN6VZJ4Zkyb+t0Af17SLnwun91bFEUMdgA1hUkTrFgIbSSGbw5/U7vwWtD7sJZBj/ikzCwrY2MVmmmg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222799; c=relaxed/simple; bh=gLvBbuGkoQJzWj+visP84phl5aqwxR7XVsLyoawyYjk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lq3oDq0yqGxGIyxV9GcEHJ4tKYo+lTQ50xSbjTxe4mRnbnRpyAgqsyRZD5OLSvylZy3JW744ftEoenNc54Fwc8tH+0dTw4a6IrS31Gi0SLnDLdvh2+vwMMc212O3Vys/IhwyHokHbIlbXl1UcaRG83jd80WmoT/IWCbEifEVW0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RyR1dJGT; 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="RyR1dJGT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97253C4CEED; Fri, 15 Aug 2025 01:53:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222799; bh=gLvBbuGkoQJzWj+visP84phl5aqwxR7XVsLyoawyYjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RyR1dJGTzB/CFKgXUDQACrEkhLdIZAIVGYgVR1x2iPuqmcgvF4l5uJsZvO1IOXWLy OHL/LYMtLop4LfHOQBeP24OWTts2l6o5SNwb4ak1Z4loxHzWYDmQLbx++g7c6/+Sbe SSDzOwo/SjxgpDdKpQ9/w2dW/2Ykoxma92AZMH9BevLfAr65etEtGlpiNeZTpmZ+hJ fTlhodYwajMRdoalXCWd/nVj14uACt7rpj9XBB5iuHAGROYPMPuthtcA/wfTFTqoFQ W+xSdoJdfQjLqToIG3XkkOdNDqL+lGrpT3RZkdK3jhs6tdfPKNhFO8g+Co2CRhan4u 36hpkYd60NWKw== 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 15/38] mmc: sdhci-acpi: use modern PM macros Date: Fri, 15 Aug 2025 09:33:50 +0800 Message-ID: <20250815013413.28641-16-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 Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-acpi.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 2d46d4854fa1..84c7054607fc 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c @@ -973,8 +973,7 @@ static void sdhci_acpi_remove(struct platform_device *p= dev) c->slot->free_slot(pdev); } =20 -static void __maybe_unused sdhci_acpi_reset_signal_voltage_if_needed( - struct device *dev) +static void sdhci_acpi_reset_signal_voltage_if_needed(struct device *dev) { struct sdhci_acpi_host *c =3D dev_get_drvdata(dev); struct sdhci_host *host =3D c->host; @@ -989,8 +988,6 @@ static void __maybe_unused sdhci_acpi_reset_signal_volt= age_if_needed( } } =20 -#ifdef CONFIG_PM_SLEEP - static int sdhci_acpi_suspend(struct device *dev) { struct sdhci_acpi_host *c =3D dev_get_drvdata(dev); @@ -1017,10 +1014,6 @@ static int sdhci_acpi_resume(struct device *dev) return sdhci_resume_host(c->host); } =20 -#endif - -#ifdef CONFIG_PM - static int sdhci_acpi_runtime_suspend(struct device *dev) { struct sdhci_acpi_host *c =3D dev_get_drvdata(dev); @@ -1045,12 +1038,9 @@ static int sdhci_acpi_runtime_resume(struct device *= dev) return 0; } =20 -#endif - static const struct dev_pm_ops sdhci_acpi_pm_ops =3D { - 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, NUL= L) }; =20 static struct platform_driver sdhci_acpi_driver =3D { @@ -1058,7 +1048,7 @@ static struct platform_driver sdhci_acpi_driver =3D { .name =3D "sdhci-acpi", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .acpi_match_table =3D sdhci_acpi_ids, - .pm =3D &sdhci_acpi_pm_ops, + .pm =3D pm_ptr(&sdhci_acpi_pm_ops), }, .probe =3D sdhci_acpi_probe, .remove =3D sdhci_acpi_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 4ACF7296BDF; Fri, 15 Aug 2025 01:53:26 +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=1755222807; cv=none; b=TTnGVQz7ui6X4gWPK0NAXwORZfxB1BXgyxGrIJx6fc+nTx59bz803uqLUWcVmL6PblvDC1uOye4+AqOLCWAQuE5m9XVVJRmj1J1yqhP3AJW717diJNrhzGFlMLZrBdCpNQgmxVJCrz4CmwcVv7n9FALSZU3s8PHqaVFEOcXEe7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222807; c=relaxed/simple; bh=YHFUwlHlhBKsJ5yZ5yqkXs/Purgd1GS7WR1VUPMWAt0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MXHIIUueVuI+QYsb19oXDk7x9uFkAqCKkL2Ha5EM2USCmM6ERlXypvtjcRZGUsDdZsd0+bzCBWj4sIjG0otGOY6GfGzfGHEIdOsmeuKQVybiJPxmoBkOPjzNDLt0hh/U5trAjwbwUVB+ej/aINr+Yt6eZDmNco9JjZKHtZ97/h8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QucpIfWu; 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="QucpIfWu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E2F74C4CEF6; Fri, 15 Aug 2025 01:53:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222806; bh=YHFUwlHlhBKsJ5yZ5yqkXs/Purgd1GS7WR1VUPMWAt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QucpIfWuarf1LW5+Mn2mNMWk6v0LhEgN0WU/S47R5wJtyW35lILfLPVJcPTYoLG57 gGdSCKLkhVwhurW6Mtp2hfTlxQ6w/pfmHhK08fDWt99KsAejVUz4ZZzGOCGRdIcoz0 dKnYyHSgToGa/UJXnblKWfmzyAhBrl9s7S6Zo/B6jwkX5SuMnH4Hvw1/9Cb2GV6Wky imdZJc8ISrVoXUZAnns5ZBRQ0CS9XH2ulVT1kYTRuKrOPOpau6tfruP1rGaGlJWQ0/ +xADkVGgiNzF3STcR7MM9dOJ/5Ox2FgY24eUjRVGoRfyGdH7Z1jcH7gaSMjba6b8y0 aVYZy37reN1Bw== 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 16/38] mmc: sdhci_am654: use modern PM macros Date: Fri, 15 Aug 2025 09:33:51 +0800 Message-ID: <20250815013413.28641-17-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/sdhci_am654.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sdhci_am654.c b/drivers/mmc/host/sdhci_am654.c index e4fc345be7e5..48bf5532e571 100644 --- a/drivers/mmc/host/sdhci_am654.c +++ b/drivers/mmc/host/sdhci_am654.c @@ -1018,7 +1018,6 @@ static void sdhci_am654_remove(struct platform_device= *pdev) pm_runtime_put_noidle(dev); } =20 -#ifdef CONFIG_PM static int sdhci_am654_restore(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -1106,20 +1105,17 @@ static int sdhci_am654_runtime_resume(struct device= *dev) =20 return 0; } -#endif =20 static const struct dev_pm_ops sdhci_am654_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(sdhci_am654_runtime_suspend, - sdhci_am654_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) + RUNTIME_PM_OPS(sdhci_am654_runtime_suspend, sdhci_am654_runtime_resume, N= ULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; =20 static struct platform_driver sdhci_am654_driver =3D { .driver =3D { .name =3D "sdhci-am654", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sdhci_am654_dev_pm_ops, + .pm =3D pm_ptr(&sdhci_am654_dev_pm_ops), .of_match_table =3D sdhci_am654_of_match, }, .probe =3D sdhci_am654_probe, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 E13DC29344F; Fri, 15 Aug 2025 01:53:34 +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=1755222815; cv=none; b=MOYQdkKL21uy93q22wa1DeE6AkTQ3T7/iNEv3K6SBddjeh8pOOhaxIfcy83x0gs6/MD8+Q1so62jOXmXr2VLI0JLzKYubuMqykycnE6A59dzaItAQPwzQL2ZplWYAuw0NtoTxhNT7hRSZTQM4wa2+zqd8fCsMAznYRkQ19wZRqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222815; c=relaxed/simple; bh=iJdqm6fChWwedp2Qg212RxFmubV9KbL+zQFWdcThFmU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V7KzbZgd0i510EGo74rJNUpYatJ4Fi3Wa2NWLxKHiRQGTYvcErjDTKmZB9+1S19bIktJ1PpoKiuM6phACIcY2zgZTvYI6FGFyhO/AyqPbknr6bj5wfKK3vvmiARBs3x7jBbafG7UrNVL/H3j1gz9HE4BZVaRW0yiBBJreaCwFiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XLZuYmwt; 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="XLZuYmwt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B2EDC4CEF1; Fri, 15 Aug 2025 01:53:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222814; bh=iJdqm6fChWwedp2Qg212RxFmubV9KbL+zQFWdcThFmU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XLZuYmwtHOgawZHbrs8le8MEYR/bhrslLCuXmTzmlh9ePiBAwNmn8qWKi2OT3qvt1 DIduGIQOWIVFcR8lxBqFd1fCQqMrRV7aURdAEqTmofgMh6OSJ/6TBBUmZdbKfWKYK9 L6MGwudUvFaN+mwX/1j8hbar75j07GD1qlz29unB+KABOegvBADlds6VHSkKv1wjg9 GvssvpcQ545H62GkC+1qy4LAdEc9CnyuoknqFM+0+TfDfxbOkQypiMVMrLbbGxfkGe 1Nu2vgjF/7e4r007hcFP7499UWdnBvwx21LhqHTHKO0lwo3eY5BqZRDKSByJRa7yYi a/+Iufw2UGzBg== 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 17/38] mmc: sdhci-brcmstb: use modern PM macros Date: Fri, 15 Aug 2025 09:33:52 +0800 Message-ID: <20250815013413.28641-18-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/sdhci-brcmstb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcm= stb.c index efc2f3bdc631..15705e85417f 100644 --- a/drivers/mmc/host/sdhci-brcmstb.c +++ b/drivers/mmc/host/sdhci-brcmstb.c @@ -496,7 +496,6 @@ static void sdhci_brcmstb_shutdown(struct platform_devi= ce *pdev) =20 MODULE_DEVICE_TABLE(of, sdhci_brcm_of_match); =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_brcmstb_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -540,17 +539,14 @@ static int sdhci_brcmstb_resume(struct device *dev) =20 return ret; } -#endif =20 -static const struct dev_pm_ops sdhci_brcmstb_pmops =3D { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_brcmstb_suspend, sdhci_brcmstb_resume) -}; +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_brcmstb_pmops, sdhci_brcmstb_suspend= , sdhci_brcmstb_resume); =20 static struct platform_driver sdhci_brcmstb_driver =3D { .driver =3D { .name =3D "sdhci-brcmstb", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sdhci_brcmstb_pmops, + .pm =3D pm_sleep_ptr(&sdhci_brcmstb_pmops), .of_match_table =3D of_match_ptr(sdhci_brcm_of_match), }, .probe =3D sdhci_brcmstb_probe, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 2B66E29344F; Fri, 15 Aug 2025 01:53:42 +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=1755222823; cv=none; b=Jx65N1ZnGgOOzCxF+YarpCcTSWH8O3cXB0La+MmK5WNhExVgWGHGPOnG6feW+NFYiP/pBUkb7Tyx9zGPwpB01+iY62AvmU3C/FUhJEWjhp3uOoTkc/HpsOBLtiVLawCQAnTrx1XbgVKz7csLPcR8C1ocSr3AuAd6581f4ZxHicE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222823; c=relaxed/simple; bh=GKhcDi4HWFWwr3pajLQPCJLuDx+zYQo5xPViOOs7nCs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fEomxWNi3R5nDmx9iT/TBnplPCLL0RyEc+ebxpYZfmAGmToERQ+rr8q+ktL95b9nQrp6qCpj1uh7SSCBdecMUBQXAq7zEoJueQHylM+O9teEo0zx4Ah9hVdsEY5/k/yP1rIU40J4MgLe6yNFBNUEKV8JbseZni019x/osN9s8Yc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kWJWeBFq; 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="kWJWeBFq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A78AC4CEED; Fri, 15 Aug 2025 01:53:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222822; bh=GKhcDi4HWFWwr3pajLQPCJLuDx+zYQo5xPViOOs7nCs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kWJWeBFq7eKqnGcMu+sIhicxUZxbUaeM6ba6RccfbF/2dBSBC3rUY+Z7OAkD5OXpi hdi/j2S5jjvEVAQY/d0VbBxi7TjMvCZhey0dtD3PgsgdpSHYbgrDyb55paio6w71kZ nPB6HcSHLF0X/+HEQAURNW3Y1XDMm5wpkxtGaV8AHXog6sJO0q0Z9ynSCiw4lUb6fH RobI31dstAdof/57F/Rc+pLnmieKT/zjBTMrbEYz008rtvMhV9gl+AT7wd5ucNhmrr iT8nN3Pw45SPsHNfIZcU6UhrAGQQRka/wRfy/RUrWpIsJ2tgoUI1kax0SB5YKAyIKO THkc2wda48foQ== 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 18/38] mmc: sdhci-esdhc-imx: use modern PM macros Date: Fri, 15 Aug 2025 09:33:53 +0800 Message-ID: <20250815013413.28641-19-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/sdhci-esdhc-imx.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-es= dhc-imx.c index a040c0896a7b..a7a5df673b0f 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1650,7 +1650,6 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host = *host) } } =20 -#ifdef CONFIG_PM_SLEEP static void sdhc_esdhc_tuning_save(struct sdhci_host *host) { struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -1707,7 +1706,6 @@ static void sdhc_esdhc_tuning_restore(struct sdhci_ho= st *host) host->ioaddr + ESDHC_TUNE_CTRL_STATUS); } } -#endif =20 static void esdhc_cqe_enable(struct mmc_host *mmc) { @@ -2016,7 +2014,6 @@ static void sdhci_esdhc_imx_remove(struct platform_de= vice *pdev) cpu_latency_qos_remove_request(&imx_data->pm_qos_req); } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_esdhc_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -2112,9 +2109,7 @@ static int sdhci_esdhc_resume(struct device *dev) =20 return ret; } -#endif =20 -#ifdef CONFIG_PM static int sdhci_esdhc_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -2188,12 +2183,10 @@ static int sdhci_esdhc_runtime_resume(struct device= *dev) cpu_latency_qos_remove_request(&imx_data->pm_qos_req); return err; } -#endif =20 static const struct dev_pm_ops sdhci_esdhc_pmops =3D { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume) - SET_RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend, - sdhci_esdhc_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(sdhci_esdhc_suspend, sdhci_esdhc_resume) + RUNTIME_PM_OPS(sdhci_esdhc_runtime_suspend, sdhci_esdhc_runtime_resume, N= ULL) }; =20 static struct platform_driver sdhci_esdhc_imx_driver =3D { @@ -2201,7 +2194,7 @@ static struct platform_driver sdhci_esdhc_imx_driver = =3D { .name =3D "sdhci-esdhc-imx", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D imx_esdhc_dt_ids, - .pm =3D &sdhci_esdhc_pmops, + .pm =3D pm_ptr(&sdhci_esdhc_pmops), }, .probe =3D sdhci_esdhc_imx_probe, .remove =3D sdhci_esdhc_imx_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 E645C1459F7; Fri, 15 Aug 2025 01:53:50 +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=1755222831; cv=none; b=JCgaUdf11Hoz3hmMYgpj6pEtyrwwEvIpQrdfItFGDUYr2d7pWpqzRlNvjEp1wf1frXS5PESjYBtnWWE+Lw8GWYhWGpCTTWCVCD20HUR3ipDEikyeKRh3d9e2AgCYbdG0uVfbX5eeDPEdm8BVrNtO0HBeqyfKhHJT2c+EelLDZ00= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222831; c=relaxed/simple; bh=Ux36/+4yl2iQkvaT8m/hv4l9xmuFgZ2Qi1WQEgYGMhE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IsVDq346zXNJa7xZ+QuieqcgjAKcUuXzGxK8lP1en5l/zkA/j0Xrv0t4nV2aMmEgWwvh1ZYTdjgb6xYs/Ob0/jVzPGQDIAw4K+/xGQkhP23aal5Km46+7DBzcVzKS43SOCKHAEaw/bf9L/D7EYG6XjN77D+nDBfNlMsk8TO19EQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mTG83LuV; 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="mTG83LuV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D238C4CEF1; Fri, 15 Aug 2025 01:53:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222830; bh=Ux36/+4yl2iQkvaT8m/hv4l9xmuFgZ2Qi1WQEgYGMhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mTG83LuVzFIvF0a3sV26/ciH2Ly6BSbsJxlCxeysvh8N9eRFiDaTHCz/AxI3tM7t/ kdiLu6NuhWS1JIDTPhP67GeHW/BHsYRIpcT4U99xG+TXN4kg3iU7VRj1qqrMUjB1px NdC/AHo0FE7iT95bkn1Qq3LePDksMPB03nUwCMgpLMwQKKYqVaJnefcsfnJqnaQ2Uw NgJaHhVxbJylkqb8MVr0j1GgkS6p55pA6y4UoW2KxQ/1G+0FWflK6j5hVu9+mHdFBs Sz1NV1bTZGfuIP0Cqcr77ujy0Ylvonj1M6pFe4hql10f82B3pff+vsM/6BQaLWsRwC QiVjMAlc2KY1A== 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 19/38] mmc: sdhci-of-arasan: use modern PM macros Date: Fri, 15 Aug 2025 09:33:54 +0800 Message-ID: <20250815013413.28641-20-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/sdhci-of-arasan.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of= -arasan.c index 42878474e56e..d0939b5bc1a6 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -581,7 +581,6 @@ static const struct sdhci_pltfm_data sdhci_arasan_cqe_p= data =3D { SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN, }; =20 -#ifdef CONFIG_PM_SLEEP /** * sdhci_arasan_suspend - Suspend method for the driver * @dev: Address of the device structure @@ -675,10 +674,9 @@ static int sdhci_arasan_resume(struct device *dev) =20 return 0; } -#endif /* ! CONFIG_PM_SLEEP */ =20 -static SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_suspend, - sdhci_arasan_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_arasan_dev_pm_ops, sdhci_arasan_susp= end, + sdhci_arasan_resume); =20 /** * sdhci_arasan_sdcardclk_recalc_rate - Return the card clock rate @@ -2051,7 +2049,7 @@ static struct platform_driver sdhci_arasan_driver =3D= { .name =3D "sdhci-arasan", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_arasan_of_match, - .pm =3D &sdhci_arasan_dev_pm_ops, + .pm =3D pm_sleep_ptr(&sdhci_arasan_dev_pm_ops), }, .probe =3D sdhci_arasan_probe, .remove =3D sdhci_arasan_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 478B6298CB1; Fri, 15 Aug 2025 01:53:58 +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=1755222839; cv=none; b=cTD4wQYzYbMX78Eg2dFm0buxGScT2wFuowliIXBOAVISLHMWxOeEI1SQaUIYhhYaH0S4so/g83rh3yH6GS/RklBblj2NrkfNuomPtu93sx1+OpOKqrEuUghXX0GryTjFbh/sf/I1sWmjl0wLaeCATK/R6JAANGXnVZNBQplC+Zo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222839; c=relaxed/simple; bh=dUnZJf0fPVnkZVwOXFMDCViTMe3JuJxKZh0p/jfBxS8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S7J85DKxZLrOwAnYkDfNq+dAv9TVfmtXCeYZ32TM+iytSr8zLdm7Bj3DtY+mCFG/GPMqqAOqbn8xRYY86a6GyuBN60UERFLPHQzGf9fU/c4OHdOnRLd44OEsAlMF40aMYTTNxtN2+EZGi0wb58BuAVyT2pf4BowZLkEpEaVxBtI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XYnlBBBc; 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="XYnlBBBc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F1D2C4CEF7; Fri, 15 Aug 2025 01:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222838; bh=dUnZJf0fPVnkZVwOXFMDCViTMe3JuJxKZh0p/jfBxS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XYnlBBBcY3wdoPrtw6iXcYvQJymPF52fQvTYWmDaZ766EvFsIwBXQD28VruhOyMbY fzat/+dp8uvfXBRjY7HafzX/PobdyoBTTG7Y/VnvrDN1GnsgVKbYlx7oLSy0lw5kws OjYkfoixl8X82WJnxbEe+bJidkaku33uzSfy/xc8SlKMCPRLWlrIhdKZzqmhiZKdAW IRLzhX+WeqffdJ39GGGLGe2jqGosm1RhE4v5NuhrX65TO+UWR2KiVjwVgQJJEd4hL3 VIxo3jBr4Em0UNpN6F1i22QaLOTp/5r0SJF7YRc8hVZ4CBUppjf+NB3ty001S+5LTK CeDbvRCB3FOPA== 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 20/38] mmc: sdhci-of-at91: use modern PM macros Date: Fri, 15 Aug 2025 09:33:55 +0800 Message-ID: <20250815013413.28641-21-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/sdhci-of-at91.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-a= t91.c index 1ba2effaf376..7c4ac65f247d 100644 --- a/drivers/mmc/host/sdhci-of-at91.c +++ b/drivers/mmc/host/sdhci-of-at91.c @@ -229,7 +229,6 @@ static int sdhci_at91_set_clks_presets(struct device *d= ev) return 0; } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_at91_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -243,9 +242,7 @@ static int sdhci_at91_suspend(struct device *dev) =20 return ret; } -#endif /* CONFIG_PM_SLEEP */ =20 -#ifdef CONFIG_PM static int sdhci_at91_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -302,13 +299,10 @@ static int sdhci_at91_runtime_resume(struct device *d= ev) sdhci_runtime_resume_host(host, 0); return 0; } -#endif /* CONFIG_PM */ =20 static const struct dev_pm_ops sdhci_at91_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_at91_suspend, pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(sdhci_at91_runtime_suspend, - sdhci_at91_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(sdhci_at91_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(sdhci_at91_runtime_suspend, sdhci_at91_runtime_resume, NUL= L) }; =20 static int sdhci_at91_probe(struct platform_device *pdev) @@ -460,7 +454,7 @@ static struct platform_driver sdhci_at91_driver =3D { .name =3D "sdhci-at91", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_at91_dt_match, - .pm =3D &sdhci_at91_dev_pm_ops, + .pm =3D pm_ptr(&sdhci_at91_dev_pm_ops), }, .probe =3D sdhci_at91_probe, .remove =3D sdhci_at91_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 28E0317B425; Fri, 15 Aug 2025 01:54:06 +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=1755222847; cv=none; b=bOscgD4WezWi5uxBOyFDWPzKcTZIXGO772RSckHSZ+jhk6V+V6JTSsG14X3anIsJ5Y3wVbVYR5tPmt+LGv/WXD4+3DDnzap8rF6x4abmCAW1bMrHFijtfy/DCeWBFHxJndE1mJTVUR9YepuYKWqBcfPJXxDtw62JwHniXXofisM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222847; c=relaxed/simple; bh=J6J27b6ZY/lIVsGzB/5kKFuMsLpEdftsz7uY/8ELpPM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RHoVOJmnDHvuD8UX0gwx/3HFVZ8L9zfr1xfuvtD1Ip/UnB/Opkc/Bx2LgL4oFDo3x6n1RI4SFvAfgKo55+4QsTudD1xo4+SndXFdjWRgDGgJ/auud1nYt5n8tdMySW1kLNAPSR6B6TDiP+Lg4kQnSuaSe7L6Bhny9Q6rM1Jazg0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RYmaDxvq; 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="RYmaDxvq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40DEDC4CEED; Fri, 15 Aug 2025 01:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222846; bh=J6J27b6ZY/lIVsGzB/5kKFuMsLpEdftsz7uY/8ELpPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYmaDxvqZWhdCT+s1rUnuT70Ro4RzSmRn480BP7LnWpXvoeicxUW8ECz23t9WWn8F ClIrVPk0ifVqWkPbsbzo39Mz/WvH2RrHE2ND+jOrQA1eQfzadp9+rKWoBqLvXsi0CH +Gn3wmo06niX05EaJcmSnrPaR4NSjMFnNG4AQrTjbtYwu4MuHjc/wLQtIBe2u+4gYH sxba6cy8QMexNzq6Dem0VG5/59Me9zW7DrDLkCl1sSGqc+14VS9aXio8RS7BWlV+UD xtgvwRkoQx2P0YnPu1m/yX2cmokbE72eDoNaQlmLslFH9PHfqiXRIQO054ywdnPN2o 2dIVOUfUO1QZg== 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 21/38] mmc: sdhci-of-esdhc: use modern PM macros Date: Fri, 15 Aug 2025 09:33:56 +0800 Message-ID: <20250815013413.28641-22-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/sdhci-of-esdhc.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-= esdhc.c index c6ee0099ead0..8345e2c5a034 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -1234,7 +1234,6 @@ static u32 esdhc_irq(struct sdhci_host *host, u32 int= mask) return intmask; } =20 -#ifdef CONFIG_PM_SLEEP static u32 esdhc_proctl; static int esdhc_of_suspend(struct device *dev) { @@ -1260,11 +1259,8 @@ static int esdhc_of_resume(struct device *dev) } return ret; } -#endif =20 -static SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops, - esdhc_of_suspend, - esdhc_of_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(esdhc_of_dev_pm_ops, esdhc_of_suspend, esd= hc_of_resume); =20 static const struct sdhci_ops sdhci_esdhc_be_ops =3D { .read_l =3D esdhc_be_readl, @@ -1511,7 +1507,7 @@ static struct platform_driver sdhci_esdhc_driver =3D { .name =3D "sdhci-esdhc", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_esdhc_of_match, - .pm =3D &esdhc_of_dev_pm_ops, + .pm =3D pm_sleep_ptr(&esdhc_of_dev_pm_ops), }, .probe =3D sdhci_esdhc_probe, .remove =3D sdhci_pltfm_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 63A3917B425; Fri, 15 Aug 2025 01:54:14 +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=1755222857; cv=none; b=NrFBJ95A+5zflnEhaSS5xhn6+ZoNqZAuDuZTpq3HGsq3z1z4j6a5v0jiZXsSEvVobXIezUr9vLJQdLxH89iBVzc8qYxxcBxucLdm2yycluUmIx/+mbtJZzlhGI9DELAkMkhU83f6+9YxGEZyTmim8qVvPz7f/Zuii+iJir1rQ5I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222857; c=relaxed/simple; bh=7GhD3DnX4djD7Vr1Ea8aB9eSRTm/evft74otUw4IJg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uTbPzdrVOOyIQj+/UhTSwaMLmDF3IeWBZTYTQp9/EMkrPJccTLLb+Y5cwq558XT31MhKYiV0NlQ+fDafoR2QX7Ci4EVxOGQEkvuPY6EgNfrmsuiPZy+IIxOf2/L2WIj43F8xlcAc9EIeZwpnSYhAiy83MP8D4/+ejTXmpNMSPDE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iz2zQGeN; 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="iz2zQGeN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4099FC4CEF1; Fri, 15 Aug 2025 01:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222854; bh=7GhD3DnX4djD7Vr1Ea8aB9eSRTm/evft74otUw4IJg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iz2zQGeNI0OSbBAbZqn5iCJYn0Bu4VRlGo2oeUsTfGB8Z1Jpv1x/QCNkdxmeBm3GC n7V19MxLnRa9R9tRr5wFufARLNsLrHKXFerQRgb5P+WKRts3saKpWezEjdOlmuYlah lgoWmgastZh28HeukMFH6ktgZpFoABff51vJE7w8YRdFuanOjiO4QBl2HZoSyZxV6D Wzpmc8eQrjqcwauWS7DnoFB2nHL1jEPpG9s1GmTs+Z7cqLqJX++TlAWAaNrdK/PR9l Cgk8nbuAYt6Ur5DuqKIFS4i1WPsx6qihbyKr3HS6eglZWx9cHbSnWHON2d+waXXsqo /5n+FibBKy05A== 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 22/38] mmc: sdhci-omap: use modern PM macros Date: Fri, 15 Aug 2025 09:33:57 +0800 Message-ID: <20250815013413.28641-23-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/sdhci-omap.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index cdb09605e009..b5d7c1a80a92 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -1400,8 +1400,7 @@ static void sdhci_omap_remove(struct platform_device = *pdev) pm_runtime_force_suspend(dev); } =20 -#ifdef CONFIG_PM -static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host = *omap_host) +static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host) { omap_host->con =3D sdhci_omap_readl(omap_host, SDHCI_OMAP_CON); omap_host->hctl =3D sdhci_omap_readl(omap_host, SDHCI_OMAP_HCTL); @@ -1412,7 +1411,7 @@ static void __maybe_unused sdhci_omap_context_save(st= ruct sdhci_omap_host *omap_ } =20 /* Order matters here, HCTL must be restored in two phases */ -static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_ho= st *omap_host) +static void sdhci_omap_context_restore(struct sdhci_omap_host *omap_host) { sdhci_omap_writel(omap_host, SDHCI_OMAP_HCTL, omap_host->hctl); sdhci_omap_writel(omap_host, SDHCI_OMAP_CAPA, omap_host->capa); @@ -1424,7 +1423,7 @@ static void __maybe_unused sdhci_omap_context_restore= (struct sdhci_omap_host *om sdhci_omap_writel(omap_host, SDHCI_OMAP_ISE, omap_host->ise); } =20 -static int __maybe_unused sdhci_omap_runtime_suspend(struct device *dev) +static int sdhci_omap_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -1443,7 +1442,7 @@ static int __maybe_unused sdhci_omap_runtime_suspend(= struct device *dev) return 0; } =20 -static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev) +static int sdhci_omap_runtime_resume(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -1458,13 +1457,10 @@ static int __maybe_unused sdhci_omap_runtime_resume= (struct device *dev) =20 return 0; } -#endif =20 static const struct dev_pm_ops sdhci_omap_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(sdhci_omap_runtime_suspend, - sdhci_omap_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) + RUNTIME_PM_OPS(sdhci_omap_runtime_suspend, sdhci_omap_runtime_resume, NUL= L) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; =20 static struct platform_driver sdhci_omap_driver =3D { @@ -1473,7 +1469,7 @@ static struct platform_driver sdhci_omap_driver =3D { .driver =3D { .name =3D "sdhci-omap", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sdhci_omap_dev_pm_ops, + .pm =3D pm_ptr(&sdhci_omap_dev_pm_ops), .of_match_table =3D omap_sdhci_match, }, }; --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 ECF1B28CF7C; Fri, 15 Aug 2025 01:54:22 +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=1755222863; cv=none; b=Dzfpm58FnO3TXDvd5KyrZu3OyI9Q+CDUbPRY4YqqDt+Bh5hh3TX3vqrog/7AbXgjTyG4miT1Zw6/AA0Bf9Akr6QpguUQnnFwOp9LgiyjLFS+ohqRl16c6UwMbdgygPfC8WUq8cd3/t12i8sZlo4wpLtp+oLuxdW8b5s9YoZrqeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222863; c=relaxed/simple; bh=zsWEaRqQM6tmd2c+fncO7p4Tpm64+i/AVDndX8KLebc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G/eiJtLQj22EUkpp5ZQZ4+1YsZVSjr43ueOde4nTtXCNyXna+4UpdDatejUdnTD/BxV6IkDo/mK2q+N/efpkUhrZUlk09EcXxncv4JYljL906Km+HNt0hiJJL5+lKB+WIYxTmT9cYcauUpUN5S1VB9KZY8NcoGndmQ5mELEXX1g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SFynERfK; 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="SFynERfK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 417C9C4CEED; Fri, 15 Aug 2025 01:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222862; bh=zsWEaRqQM6tmd2c+fncO7p4Tpm64+i/AVDndX8KLebc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFynERfKhCtrM9XVoOAquRH4uvw1WEV7WBtGWb6KDxpifTA2gmx6lTFKoZNyHLsJp Vkk4v63+jU/gW556gLVD8FBsNDPTiRF3LYUgEkd8MpkFUdtCEO3duKoIw6aaFmye2O CqqAOQgKWqSHrD87KqyaVbM8Ql4/uzm72MFl4sSUZtLb/bTznep2KugeVWhxRzkCUY QeELq6yqkxoE62tQdDQvDHxuMG4AoDRxuc+n0uqTsYOaQ+U5mmBg4fo4rDhSuFCJzK uTOANE+RswWK5SrRtBwPfDbhN/ZuiClZhqCy1qzSP78eqFBY9OLRGPBPtFqo+/BpBL 7J05wvzmwAzdg== 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 23/38] mmc: sdhci-cadence: use modern PM macros Date: Fri, 15 Aug 2025 09:33:58 +0800 Message-ID: <20250815013413.28641-24-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/sdhci-cadence.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-cadence.c b/drivers/mmc/host/sdhci-cade= nce.c index 2d823e158c59..60a297628b06 100644 --- a/drivers/mmc/host/sdhci-cadence.c +++ b/drivers/mmc/host/sdhci-cadence.c @@ -551,7 +551,6 @@ static int sdhci_cdns_probe(struct platform_device *pde= v) return sdhci_add_host(host); } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_cdns_resume(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -578,11 +577,8 @@ static int sdhci_cdns_resume(struct device *dev) =20 return ret; } -#endif =20 -static const struct dev_pm_ops sdhci_cdns_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_pltfm_suspend, sdhci_cdns_resume) -}; +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_cdns_pm_ops, sdhci_pltfm_suspend, sd= hci_cdns_resume); =20 static const struct of_device_id sdhci_cdns_match[] =3D { { @@ -606,7 +602,7 @@ static struct platform_driver sdhci_cdns_driver =3D { .driver =3D { .name =3D "sdhci-cdns", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sdhci_cdns_pm_ops, + .pm =3D pm_sleep_ptr(&sdhci_cdns_pm_ops), .of_match_table =3D sdhci_cdns_match, }, .probe =3D sdhci_cdns_probe, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 EF590295537; Fri, 15 Aug 2025 01:54:30 +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=1755222871; cv=none; b=mhRIyGmVR8Y3obZPCPpo9P3qEJxVngOmTxVsVJoXLvllODtAq4coiIPh7ILz9MHz4/a8hU6muLQXpafpuwrChQezxOmB/HZaKMnNSxqMcKqh9VWj97N1PCCQZAyv8tHvEdNA5Z5hE8H2mkzX7xyqJXZuEZQE7h1SYr2yYZS6X+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222871; c=relaxed/simple; bh=Xtt0Gh+8rnJkc7bnfTKTYzJ6uGY9+nZj9Zh0PXtUiSU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l9Wa5Gs7KloVPKtZzcdPgVynPVO4hmGKnsY9DXLpias2zOBlZI2d5wRd8bWj1+xrU8QUeQRSTlGjoqDMtH4tOD1egLy4EnfXXvVu9MluQgS2auDbAI+/NTa586/U6nHj+z7weNaqn52ZEfDGHQwQAha4P0b+Cda7kztvruRclmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nzoMw8Os; 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="nzoMw8Os" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47747C4CEF1; Fri, 15 Aug 2025 01:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222870; bh=Xtt0Gh+8rnJkc7bnfTKTYzJ6uGY9+nZj9Zh0PXtUiSU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzoMw8Ostluj9UsuWcFcet5p6QRTPN+V16+FKix81XRZpr74c+MJlJEousO98mu8w 7cuehjiVN7kfSl/3AcnSiqnTEthVmeMYOHwD73Tp76sAEQxqefSmfnL28kIuxRVcXu Spj73JcIfaFJi2b0Lv/3krO7BeOQ/BQOgHAgcioetmkrkT16ZW9md05mOzmoABQji8 0KJS0GttkOoyIcXum9x2I2u/iwzJH2wLq9Q8glVLXzkwyAdQB7AIumhYRy/aYdwDSK QOWXWgYuI1lCeJDzfzJ/6DBUnnkSbl4umjZkSIYYF0gVK0/uiQYN5IT8gx3c+whqVJ fdhgv5rVgJWSg== 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 24/38] mmc: sdhci-s3c: use modern PM macros Date: Fri, 15 Aug 2025 09:33:59 +0800 Message-ID: <20250815013413.28641-25-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/sdhci-s3c.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 40857fc2e21b..6bf66aaa86a6 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c @@ -681,7 +681,6 @@ static void sdhci_s3c_remove(struct platform_device *pd= ev) clk_disable_unprepare(sc->clk_io); } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_s3c_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -698,9 +697,7 @@ static int sdhci_s3c_resume(struct device *dev) =20 return sdhci_resume_host(host); } -#endif =20 -#ifdef CONFIG_PM static int sdhci_s3c_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -730,12 +727,10 @@ static int sdhci_s3c_runtime_resume(struct device *de= v) sdhci_runtime_resume_host(host, 0); return 0; } -#endif =20 static const struct dev_pm_ops sdhci_s3c_pmops =3D { - SET_SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume) - SET_RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(sdhci_s3c_suspend, sdhci_s3c_resume) + RUNTIME_PM_OPS(sdhci_s3c_runtime_suspend, sdhci_s3c_runtime_resume, NULL) }; =20 static const struct platform_device_id sdhci_s3c_driver_ids[] =3D { @@ -770,7 +765,7 @@ static struct platform_driver sdhci_s3c_driver =3D { .name =3D "s3c-sdhci", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D of_match_ptr(sdhci_s3c_dt_match), - .pm =3D &sdhci_s3c_pmops, + .pm =3D pm_ptr(&sdhci_s3c_pmops), }, }; =20 --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 8D71429CB3E; Fri, 15 Aug 2025 01:54:38 +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=1755222878; cv=none; b=gE0MRpU+vA+E+NRJoZuVR6Uif++U5H6G0OMzbkDujXs0lTiwEDfd/Q5jHMjmtzVEtHiHQCCzmLDFmBIFY3vUzq1bQ9uyAYM6QvYp9p/4st85w8h1YeZHPOWMqPJwAN99NpZz092vZSysGCX6f/hRHmEepDllVOuikiLB0fTC4Sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222878; c=relaxed/simple; bh=L9nwWEBfXJuPHyqSS33q6AaeSPO5IJkCOi0sAgxs/00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HsIu0BrNHpu51bDMO2jPDp3hQGbRqLXWHry7s6UG3yPwRWI28LpmrjVCz9PucUyVKyX7GwvuHQ9BURi2eX3wE3xtSPhvZXjUtZDoSdJp8PUy3D7pLACvA6uBhX1PfbazCZHmTdZjsaoga/3dGw31oD4Xo9w6YwZBtA4b/Cy6U6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dCo1hZl3; 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="dCo1hZl3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4997EC4CEF5; Fri, 15 Aug 2025 01:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222878; bh=L9nwWEBfXJuPHyqSS33q6AaeSPO5IJkCOi0sAgxs/00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dCo1hZl3h8+a0xrnd/3RE2wwmFWVthCvDvOPQaLG/501313/kl52bfN9HcfGEIRr4 RtC6gFwxLYZQkN7nFcz7vMxv4Ywpt2TdKeVwbPK6N0EiJdB4D6EDSakO0BXURmVgds 5uxItax4qqRtSefCXjrGJ7dMhnDA06jhWhmJVjE+QXYLFhPnBHiR/rpz0/KAehIDBo x41/RtmXCVdwb0mjXzgaSJH6rloO5wffkFh3APYW5+SoZ3eL0GUHQrGe4d0WSeitgf UrAeuH7EC0pa0onmM5ZF4sKtpxK9Yzlztp/LTCSImp8gNqL2FOlKvCtNDNfaIHQ7Cy NllY/r+FqVLPw== 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 25/38] mmc: sdhci-spear: use modern PM macros Date: Fri, 15 Aug 2025 09:34:00 +0800 Message-ID: <20250815013413.28641-26-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 Acked-by: Viresh Kumar --- drivers/mmc/host/sdhci-spear.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index fa0f8aeb7ee0..72d21dc0cb69 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c @@ -130,7 +130,6 @@ static void sdhci_remove(struct platform_device *pdev) clk_disable_unprepare(sdhci->clk); } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -161,9 +160,8 @@ static int sdhci_resume(struct device *dev) =20 return sdhci_resume_host(host); } -#endif =20 -static SIMPLE_DEV_PM_OPS(sdhci_pm_ops, sdhci_suspend, sdhci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_pm_ops, sdhci_suspend, sdhci_resume); =20 static const struct of_device_id sdhci_spear_id_table[] =3D { { .compatible =3D "st,spear300-sdhci" }, @@ -175,7 +173,7 @@ static struct platform_driver sdhci_driver =3D { .driver =3D { .name =3D "sdhci", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sdhci_pm_ops, + .pm =3D pm_sleep_ptr(&sdhci_pm_ops), .of_match_table =3D sdhci_spear_id_table, }, .probe =3D sdhci_probe, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 D055129ACE6; Fri, 15 Aug 2025 01:54:45 +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=1755222885; cv=none; b=sYva0zelM6RK+rPVZoM7o6zjy0brBZ1HLr0wVOpcltgqFxV0u6HEjbWBNWu2owqXXwFgQh6iyjq7Vj820GcLdXWZqEndFBqOn6oV+l30UZSrGlxHGfHk7ZbVjhEIh6Rb0oggeye8usz7yGaLCWSchQ3felQuXAlBE/uCO0qNteI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222885; c=relaxed/simple; bh=TtXJDmxezN+QVZxIQGLYSDHPqxnbwoOEA70hU7804NA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=knrMVo/jGNRIWHOiltXRLm5fsHSzyo7TlR7/GLhGWkgJZdEKN578bb4YNJSJE5kPOp8DAWK57dj8KkEF2MYRRx848VqE49N/90nClZFdLpLX+UcDIGDv8/JXtRWr2j/KWwhG55zuZoPYXXzrF0UrMdTRWhYjf7iSlIAV7AfXmCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SMWNEvJv; 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="SMWNEvJv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8F7FC4CEF1; Fri, 15 Aug 2025 01:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222885; bh=TtXJDmxezN+QVZxIQGLYSDHPqxnbwoOEA70hU7804NA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SMWNEvJvzM0oLtdZFwynmU8NMdDuBZ/xydk9OkNcJBREHSbb5xYExOdmRjF6YzCuQ ORMllVx1oDrfemI/MQC1zNCNlpyU/k/tr1eZtUSHM9z9BxuQchCOjJM3R+VYUYt/0s BJCU0YP+RU8OaPgqt7bw/2L71UXedMEwLwTPskv71/ZgHh8wjRHN/W0Vp0E+9Kohy/ VVPS9jbXdngclLmKw8bv+4uPE42oVSRoArxupZ+AVWJms/sMUIpiHGt2L6fDFz0fPN x9sx5Y9D4pe36aMNvFgd6HDqO2OJBP0ROzgV3qvAnaH5MqWXfapfc1NenY6OfEx/B+ OUf/s9U/2oDLA== 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 26/38] mmc: sdhci-sprd: use modern PM macros Date: Fri, 15 Aug 2025 09:34:01 +0800 Message-ID: <20250815013413.28641-27-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/sdhci-sprd.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c index fe2fe52b23b2..3584a2b314a9 100644 --- a/drivers/mmc/host/sdhci-sprd.c +++ b/drivers/mmc/host/sdhci-sprd.c @@ -903,7 +903,6 @@ static const struct of_device_id sdhci_sprd_of_match[] = =3D { }; MODULE_DEVICE_TABLE(of, sdhci_sprd_of_match); =20 -#ifdef CONFIG_PM static int sdhci_sprd_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -950,13 +949,10 @@ static int sdhci_sprd_runtime_resume(struct device *d= ev) =20 return ret; } -#endif =20 static const struct dev_pm_ops sdhci_sprd_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(sdhci_sprd_runtime_suspend, - sdhci_sprd_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(sdhci_sprd_runtime_suspend, sdhci_sprd_runtime_resume, NUL= L) }; =20 static struct platform_driver sdhci_sprd_driver =3D { @@ -966,7 +962,7 @@ static struct platform_driver sdhci_sprd_driver =3D { .name =3D "sdhci_sprd_r11", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_sprd_of_match, - .pm =3D &sdhci_sprd_pm_ops, + .pm =3D pm_ptr(&sdhci_sprd_pm_ops), }, }; module_platform_driver(sdhci_sprd_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 25E522BE047; Fri, 15 Aug 2025 01:54:53 +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=1755222893; cv=none; b=gwSHzha+R/vpEzVgYjV+gx1i2f3mUUtJpnSYU5xnvhkQb1LNownyNCJBHQ8UrlRNNGdo7Mjp3F0jM2B06AaUWvdXD90pdjvXbwc3FSXNvhCUUKt5CeZn+NhYose1Fj2LNDN8N1C4XIm7sCREoG1c1NNDKMmmYk+vsUScpQtAhOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222893; c=relaxed/simple; bh=ybFzf6YV6svFwnuGTcj91dczGvntOop2Tzq6/4KfK+M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZPsKI+pA5UvjOdYe649rihTbEuDFpcBP/+CSw0/piqVGD5tzOnnF/DVB5yDqOvfLiDjQkgvy7jblnDjEt8u8EYkqQF8AbfYUhrQKEpzO5yqdLxmfDICSu/ffKvNXSzXdsl2xfhJckx+5ys8vtd1bxoAxgzDZATQxMFd9dX0bAP4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RvEI/6Gg; 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="RvEI/6Gg" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D5A2C4CEF5; Fri, 15 Aug 2025 01:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222893; bh=ybFzf6YV6svFwnuGTcj91dczGvntOop2Tzq6/4KfK+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RvEI/6GgRvmsQcb9b0H7HMRf/phZSG1vldJJQYf1bqIvVKtCr+8b+SXm6V7iRd56b 5ePTAF8BjhgkDJwy1zjJ7dZIst9ZBFMUk/p7iKA1MNif4njkf3Cuau0zEyTjyfjMTp setvtAU4+88l4aIg9uDpTJS304r/LwC6UcLhGhwn30dpURfxxGFuRcgW4YGcjeXEFj MaqEWjzeGwRn/1yHM/o/UwnzqQynTDiQypSrjIzWpTrMiqOnm5aPMVn5+GLjqQ74Ww HYxXS1kX2AgD5C2NGwQ83Qq9ICH6bsHmOYnPtdLI8ksY03hFbTHhHwx9ycslWHNVVQ uqYMs2xdWE3Pg== 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 27/38] mmc: sdhci-st: use modern PM macros Date: Fri, 15 Aug 2025 09:34:02 +0800 Message-ID: <20250815013413.28641-28-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 Reviewed-by: Patrice Chotard --- drivers/mmc/host/sdhci-st.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-st.c b/drivers/mmc/host/sdhci-st.c index 9157342ff7a4..bf6685805137 100644 --- a/drivers/mmc/host/sdhci-st.c +++ b/drivers/mmc/host/sdhci-st.c @@ -445,7 +445,6 @@ static void sdhci_st_remove(struct platform_device *pde= v) reset_control_assert(rstc); } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_st_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -492,9 +491,8 @@ static int sdhci_st_resume(struct device *dev) =20 return sdhci_resume_host(host); } -#endif =20 -static SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st_resume= ); +static DEFINE_SIMPLE_DEV_PM_OPS(sdhci_st_pmops, sdhci_st_suspend, sdhci_st= _resume); =20 static const struct of_device_id st_sdhci_match[] =3D { { .compatible =3D "st,sdhci" }, @@ -509,7 +507,7 @@ static struct platform_driver sdhci_st_driver =3D { .driver =3D { .name =3D "sdhci-st", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sdhci_st_pmops, + .pm =3D pm_sleep_ptr(&sdhci_st_pmops), .of_match_table =3D st_sdhci_match, }, }; --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 6E0ED2C0F8D; Fri, 15 Aug 2025 01:55:00 +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=1755222900; cv=none; b=Bs8ccMi3qI1MX0YDy3Ttszm7ZJr4NpXHLQ2WHPkwfn1ThCSrgLprTaMuCfmcK2n1dgZmhov9YbMZLTPgM7muQv8WqnOAyWED4QrINft4MadebZN+xMCUvkitJTkkZsXF/b3f27c1tIMpDgs9ft3XEvKveAU9L76X1G3Uq4Xo8mk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222900; c=relaxed/simple; bh=5JPIejjZncvYXTZd3JyE/pN9siWmySeS5xw05Ye13EQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S//d+sBqXY5l07Fb6RKYv0LtRQzvueOt+cALzAOFiwerpkHTMk/4X4qPyT5JETWVb4JrLntgvICzwI22F+5lSbbnQhfPKCdR7hT8v2DXlgPHorSI6YZV6gO47tG/wfzLRXAQ/RqCnUFGye7Zk5wGeiM2Cwexwwl879clzm+k0Zg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qyp/pm0i; 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="qyp/pm0i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6909CC4CEED; Fri, 15 Aug 2025 01:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222900; bh=5JPIejjZncvYXTZd3JyE/pN9siWmySeS5xw05Ye13EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qyp/pm0i1e91RxQz3IWb0FSla6+Qmc1tpyi1xpm5Tt8da/ce0VgXcOenIBafi0MHg G7z1+E/xc3lXK7fKt1hhzDdbwlGV8+ri6MVZ5qLFs/oOm7GUh0hxPjoOFangqeHLK9 HSS9pHQH/XA56Su7fvgWOf+LOaDA1TtKPGpuS/NyZiuigcqbXg8JI8ELyZhbdFRXuL PktXe5etsIp0cQoVN4JZGDfWw+t5GWHxGHQ4fg1Dgko3AGa5c+hD3mqi+J/RU6X4Ij FVVS6IqRh+TosZ8MAReTwZgvV3TvBOceh63zVTMa3rCRLURw4Ugu9Y6BWgAkl8Ity4 RFGzZt08itvgA== 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 28/38] mmc: sdhci-tegra: use modern PM macros Date: Fri, 15 Aug 2025 09:34:03 +0800 Message-ID: <20250815013413.28641-29-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/sdhci-tegra.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index c811297185d8..820ce4dae58b 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -1831,7 +1831,7 @@ static void sdhci_tegra_remove(struct platform_device= *pdev) clk_disable_unprepare(tegra_host->tmclk); } =20 -static int __maybe_unused sdhci_tegra_runtime_suspend(struct device *dev) +static int sdhci_tegra_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -1841,7 +1841,7 @@ static int __maybe_unused sdhci_tegra_runtime_suspend= (struct device *dev) return 0; } =20 -static int __maybe_unused sdhci_tegra_runtime_resume(struct device *dev) +static int sdhci_tegra_runtime_resume(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -1849,7 +1849,6 @@ static int __maybe_unused sdhci_tegra_runtime_resume(= struct device *dev) return clk_prepare_enable(pltfm_host->clk); } =20 -#ifdef CONFIG_PM_SLEEP static int sdhci_tegra_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); @@ -1910,12 +1909,10 @@ static int sdhci_tegra_resume(struct device *dev) pm_runtime_force_suspend(dev); return ret; } -#endif =20 static const struct dev_pm_ops sdhci_tegra_dev_pm_ops =3D { - SET_RUNTIME_PM_OPS(sdhci_tegra_runtime_suspend, sdhci_tegra_runtime_resum= e, - NULL) - SET_SYSTEM_SLEEP_PM_OPS(sdhci_tegra_suspend, sdhci_tegra_resume) + RUNTIME_PM_OPS(sdhci_tegra_runtime_suspend, sdhci_tegra_runtime_resume, N= ULL) + SYSTEM_SLEEP_PM_OPS(sdhci_tegra_suspend, sdhci_tegra_resume) }; =20 static struct platform_driver sdhci_tegra_driver =3D { @@ -1923,7 +1920,7 @@ static struct platform_driver sdhci_tegra_driver =3D { .name =3D "sdhci-tegra", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D sdhci_tegra_dt_match, - .pm =3D &sdhci_tegra_dev_pm_ops, + .pm =3D pm_ptr(&sdhci_tegra_dev_pm_ops), }, .probe =3D sdhci_tegra_probe, .remove =3D sdhci_tegra_remove, --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 0C2202D0611; Fri, 15 Aug 2025 01:55:07 +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=1755222908; cv=none; b=f/iS9Lhgd+emywdcv3jCB4cZiIxNuZHnHcc5Y7nRGY4j0XfN+BkwkRaYn3E1eNCnFrf/9voce4wV8q5lF/K3bDSVd1svIr2qHPzVjXDplA3z81k496wWIgo4YCtjG8whKk3DeaC3e0Ag4vqqo86TzTE6sS++UL/oUTNUkGlcmDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222908; c=relaxed/simple; bh=iqqY8zQk1p/28e+Z3PtSrocfEQskqgD1t/io2W6SGFc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sbGI5jSbnhyBFyMD2pyAC6f73z/xdAh6gtyfS1c+z6gQiLWpBME4164xuODGVJ07Y4EKJFIYEH28zUrETkF9seas+YeVCidzlNY/8Zx9eDi1gseZLgF5aVDDS9lO3G8kL5URhlZKsuZ8aY/7s+NNNxJBd8t3YqnaPF7mgZsLrkE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r4Nc3Jt0; 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="r4Nc3Jt0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B36C4C4CEED; Fri, 15 Aug 2025 01:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222907; bh=iqqY8zQk1p/28e+Z3PtSrocfEQskqgD1t/io2W6SGFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4Nc3Jt0OKR/Fl/eAqfQk1IZP4MQtAVDBA5iArz6rS86z/DPWGP1X8kO0k8qeidSM v/Nf0gKeNc6OsDj9TQcZToOynUIcfQGHqEkQ6eKDGSFBvR2gR2V1KTNn1JCurkKXX/ fjD0aWmWWFw4tJ4at9QEbb8k3QZtKmJ6mAPPar8IGGIMmCGPu11d4AA6Q8cumzZ6wo 40d3UTiv5kmU9XKrxn/3FF+Vzcbdo9N2wMCUX7TmZq+a75BY9kVtNfL9j5THaVuLJf AxypypHct8zghEzKGOZme7gDQcXOMDNgMHHt80vblA4IfTgHxLZJ8hklQLtrgMy7VV J+FZqpdAunQmw== 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 29/38] mmc: sh_mmicf: use modern PM macros Date: Fri, 15 Aug 2025 09:34:04 +0800 Message-ID: <20250815013413.28641-30-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/sh_mmcif.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c index 19f84584ecfa..413c34585c90 100644 --- a/drivers/mmc/host/sh_mmcif.c +++ b/drivers/mmc/host/sh_mmcif.c @@ -1568,7 +1568,6 @@ static void sh_mmcif_remove(struct platform_device *p= dev) pm_runtime_disable(&pdev->dev); } =20 -#ifdef CONFIG_PM_SLEEP static int sh_mmcif_suspend(struct device *dev) { struct sh_mmcif_host *host =3D dev_get_drvdata(dev); @@ -1584,11 +1583,8 @@ static int sh_mmcif_resume(struct device *dev) { return 0; } -#endif =20 -static const struct dev_pm_ops sh_mmcif_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(sh_mmcif_suspend, sh_mmcif_resume) -}; +static DEFINE_SIMPLE_DEV_PM_OPS(sh_mmcif_dev_pm_ops, sh_mmcif_suspend, sh_= mmcif_resume); =20 static struct platform_driver sh_mmcif_driver =3D { .probe =3D sh_mmcif_probe, @@ -1596,7 +1592,7 @@ static struct platform_driver sh_mmcif_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D &sh_mmcif_dev_pm_ops, + .pm =3D pm_sleep_ptr(&sh_mmcif_dev_pm_ops), .of_match_table =3D sh_mmcif_of_match, }, }; --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 5BEEE292B52; Fri, 15 Aug 2025 01:55:15 +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=1755222916; cv=none; b=QnA7YyTugzM1RHr0Rc2XrOJu+iW+245PJ4W9ZJx/6jIlGnHThGOP6H3KoxfQDTw8SI2uw5cgEr9lEgRG1MbjPjprTw3zZyfuYjZOrZVgHaKZiZCx3OkulSPPJTlM1ViS8QABx/Di9UjXLYKjnbAu57M02vkXG9IrlGTf0Nox6qQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222916; c=relaxed/simple; bh=OmkHH+BV0FO3aQkqJcAtiZOudBZE3tLbZpIaJkccmEQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WxXQEJaAOD4lxxhYobcrEvkaz5CmcGdVa13vgpePv7FtWsk7jekkf3PiX4Mo2VX32N6IkAgELoFJ74dxh8no6UNdSEJyAREHzivkat7y7LgDbAFN8/6kc+dwwShYL2wPwszm6OwaEzi1lqTqAE+8/2TTjA7n2fzZPzNLlO0QN6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d1ZeR1dQ; 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="d1ZeR1dQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C520C4CEF1; Fri, 15 Aug 2025 01:55:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222914; bh=OmkHH+BV0FO3aQkqJcAtiZOudBZE3tLbZpIaJkccmEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1ZeR1dQ4X/pYWoMSzzAZK7SAhdjKYhNYU8WyOESyVUQ5r6YZPv5CbzHsGkVnLUi2 6eHkGD6ioUlPUGuKUDcC4yId/C3asaEkmanEV7wt1XHgp8ocyFHBsPdTHj1Pj+OXRG u9VvHxjEnhHmk7d3BFBYJZomK6w4u2tz/TS9wOyYj7cnC8Xg+GroQyGgCmFvOsywCs WQqskVLkkuSd6ezrpFO4QTjlfbEsIBekeYcsfIx38NsPoJLZj+66bQvIpIpxWKP+J8 NmsbwB/4U55+BQLj37wbsApVmKmhc2AFzkd86dpCiLRQr59dx8vWLBHkgV+e0LTBvy NjWyfSfvSLsEA== 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 30/38] mmc: toshsd: use modern PM macros Date: Fri, 15 Aug 2025 09:34:05 +0800 Message-ID: <20250815013413.28641-31-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/toshsd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/toshsd.c b/drivers/mmc/host/toshsd.c index e5f7f8abafc0..aa5d2511a62b 100644 --- a/drivers/mmc/host/toshsd.c +++ b/drivers/mmc/host/toshsd.c @@ -567,7 +567,6 @@ static void toshsd_powerdown(struct toshsd_host *host) pci_write_config_byte(host->pdev, SD_PCICFG_CLKSTOP, 0); } =20 -#ifdef CONFIG_PM_SLEEP static int toshsd_pm_suspend(struct device *dev) { struct pci_dev *pdev =3D to_pci_dev(dev); @@ -599,7 +598,6 @@ static int toshsd_pm_resume(struct device *dev) =20 return 0; } -#endif /* CONFIG_PM_SLEEP */ =20 static int toshsd_probe(struct pci_dev *pdev, const struct pci_device_id *= ent) { @@ -688,16 +686,14 @@ static void toshsd_remove(struct pci_dev *pdev) pci_disable_device(pdev); } =20 -static const struct dev_pm_ops toshsd_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(toshsd_pm_suspend, toshsd_pm_resume) -}; +static DEFINE_SIMPLE_DEV_PM_OPS(toshsd_pm_ops, toshsd_pm_suspend, toshsd_p= m_resume); =20 static struct pci_driver toshsd_driver =3D { .name =3D DRIVER_NAME, .id_table =3D pci_ids, .probe =3D toshsd_probe, .remove =3D toshsd_remove, - .driver.pm =3D &toshsd_pm_ops, + .driver.pm =3D pm_sleep_ptr(&toshsd_pm_ops), }; =20 module_pci_driver(toshsd_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 618D6292B52; Fri, 15 Aug 2025 01:55:22 +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=1755222922; cv=none; b=h89KxMdBpScaybKpRzsD/2jTioeOFl/ZXKrasYlD/apiDn9s/YDEV7EDIsqNTKCyOzbxP5I9+s1ANTklNmAaK9aO7gd+ky7dEVgssmw7XfOH5QFTUIdaUqGPbifez8GjQdvPCWleZlJo7RbpKBlbdfYEFQD6EAIeIvQPF9jKIV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222922; c=relaxed/simple; bh=H86uzBznaNKFfJ4yr0rczcFQsJTMFWry5uBkc9sc1Qg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICnqdFNSvfy2YqvjYUmFWYWOn2ac1xBjAL7gy5QJcuFIXszl8Q7JwBwP0UMaEVi5aBJ6QpOaSd7vgsjvFyUg+XPK2bKM0FlWcaNafl90SBV5Y1FqwXT+p6ClZgm4TPAs/HCo6FsX067fVT+/NG4LBZi2pAPHkllae3m6/qKAfwQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K7NH0pUM; 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="K7NH0pUM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59A5CC4CEED; Fri, 15 Aug 2025 01:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222922; bh=H86uzBznaNKFfJ4yr0rczcFQsJTMFWry5uBkc9sc1Qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K7NH0pUM/gCBNvW/szYr5IrExsM/KITpOJ8YBopovC78fKnWm0nJuUUBUa7tXvYue e9TImbYQ9W+aG6+sGiSkQUxqewOzAQu5kk94MTxT2mbE5mzlfkh+Yl6PfKFDTUW0o0 UbTPWfSqoiidFPO+4zeiiu4aEgXeqf8FXjYiDd3+qDMbwZh5Fy3vF61piK9fKspUcX 9002jawClFU7lZDvoH1oIsF2oPhpQYQQ/BCL6ZBV5wwC/8O/EWVgLrxrkZM+kmktBU BpW2eUjTUtZtQhEAtfj9aiCfMuShZEBlInq/96vbpps4r4iTVGzrU2JcWabaG3rd4F 3eCN+TZR2aGGQ== 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 31/38] mmc: wmt-sdmmc: use modern PM macros Date: Fri, 15 Aug 2025 09:34:06 +0800 Message-ID: <20250815013413.28641-32-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/wmt-sdmmc.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c index 0d2929cfe397..1b1d691e19fc 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -911,7 +911,6 @@ static void wmt_mci_remove(struct platform_device *pdev) dev_info(&pdev->dev, "WMT MCI device removed\n"); } =20 -#ifdef CONFIG_PM static int wmt_mci_suspend(struct device *dev) { u32 reg_tmp; @@ -963,18 +962,7 @@ static int wmt_mci_resume(struct device *dev) return 0; } =20 -static const struct dev_pm_ops wmt_mci_pm =3D { - .suspend =3D wmt_mci_suspend, - .resume =3D wmt_mci_resume, -}; - -#define wmt_mci_pm_ops (&wmt_mci_pm) - -#else /* !CONFIG_PM */ - -#define wmt_mci_pm_ops NULL - -#endif +static DEFINE_SIMPLE_DEV_PM_OPS(wmt_mci_pm_ops, wmt_mci_suspend, wmt_mci_r= esume); =20 static struct platform_driver wmt_mci_driver =3D { .probe =3D wmt_mci_probe, @@ -982,7 +970,7 @@ static struct platform_driver wmt_mci_driver =3D { .driver =3D { .name =3D DRIVER_NAME, .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, - .pm =3D wmt_mci_pm_ops, + .pm =3D pm_sleep_ptr(&wmt_mci_pm_ops), .of_match_table =3D wmt_mci_dt_ids, }, }; --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 A873C292B52; Fri, 15 Aug 2025 01:55:29 +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=1755222929; cv=none; b=uU3uZNVTuHb1VvmnmYeZmQTMsUY4X/Ys5Ymj8tyR7acFeoJ0Q4I/tC664D1Y+uGsUfntIhquRRbARjG33AKVQkZmHTZS4nhhipgNhaXqwFcxDlDWxJkGShgobKE7GZdqraqlDnBOKUP+pgh26fAMmi2KdY4bzJ3XBVsJZaqjSNQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222929; c=relaxed/simple; bh=Yz6S1aReViAb+oa9fo4YKprCoSFsQvvu8L/EMETvz4o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N6YJAcAG5u1W1aI3/w8Mwho/qpQEdGEjJsVZxO97LCk0DRUcZb1hEcCvf54VI1P8T1bMWVAH29WENNl7zkv4fktDPbIH1+vki3X3b0L1cl3YRz46t/eZm/UefI+OLFERQUS4YF6AJi97qnibJCMpVBh0FjP/+QT8l0Ot9QITVi8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oo7KKsOn; 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="oo7KKsOn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3631C4CEF7; Fri, 15 Aug 2025 01:55:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222929; bh=Yz6S1aReViAb+oa9fo4YKprCoSFsQvvu8L/EMETvz4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oo7KKsOnqOrOeW8JFEspGz8d0cYNYYwDRC1lGRMvlkfLtQtoclXl4dSYJ0imBPThN 3U2yVWv1N+vNGsvwsVDpnd4Onf7L133aDlsW5y46acLC1uLdr4wM7mCvITB9jv1gf9 QT+jyZkNvC5Bldm9CItsRuOgxAkDPRR2cjO1Vmi+t6MFPZOoTAp9QYSjyKLqvArfkV pllZ4qd34NmBzPuhjZ6PKFU8zegltGajQ1N1+laWgSM4pik5U+Xa31rPiqm89pQqLk ZUTPXatTESyJkFbWra6RttFDtMAWgNHece4mcieh1paG/dtd1pC6De5sbUQgM6mPJq aUieWj0A6LygA== 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 32/38] mmc: mtk-sd: use modern PM macros Date: Fri, 15 Aug 2025 09:34:07 +0800 Message-ID: <20250815013413.28641-33-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 __maybe_unused. Signed-off-by: Jisheng Zhang --- drivers/mmc/host/mtk-sd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index d7020e06dd55..79074291e9d2 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c @@ -3278,7 +3278,7 @@ static void msdc_restore_reg(struct msdc_host *host) __msdc_enable_sdio_irq(host, 1); } =20 -static int __maybe_unused msdc_runtime_suspend(struct device *dev) +static int msdc_runtime_suspend(struct device *dev) { struct mmc_host *mmc =3D dev_get_drvdata(dev); struct msdc_host *host =3D mmc_priv(mmc); @@ -3300,7 +3300,7 @@ static int __maybe_unused msdc_runtime_suspend(struct= device *dev) return 0; } =20 -static int __maybe_unused msdc_runtime_resume(struct device *dev) +static int msdc_runtime_resume(struct device *dev) { struct mmc_host *mmc =3D dev_get_drvdata(dev); struct msdc_host *host =3D mmc_priv(mmc); @@ -3323,7 +3323,7 @@ static int __maybe_unused msdc_runtime_resume(struct = device *dev) return 0; } =20 -static int __maybe_unused msdc_suspend(struct device *dev) +static int msdc_suspend(struct device *dev) { struct mmc_host *mmc =3D dev_get_drvdata(dev); struct msdc_host *host =3D mmc_priv(mmc); @@ -3348,7 +3348,7 @@ static int __maybe_unused msdc_suspend(struct device = *dev) return pm_runtime_force_suspend(dev); } =20 -static int __maybe_unused msdc_resume(struct device *dev) +static int msdc_resume(struct device *dev) { struct mmc_host *mmc =3D dev_get_drvdata(dev); struct msdc_host *host =3D mmc_priv(mmc); @@ -3360,8 +3360,8 @@ static int __maybe_unused msdc_resume(struct device *= dev) } =20 static const struct dev_pm_ops msdc_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume) - SET_RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(msdc_suspend, msdc_resume) + RUNTIME_PM_OPS(msdc_runtime_suspend, msdc_runtime_resume, NULL) }; =20 static struct platform_driver mt_msdc_driver =3D { @@ -3371,7 +3371,7 @@ static struct platform_driver mt_msdc_driver =3D { .name =3D "mtk-msdc", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D msdc_of_ids, - .pm =3D &msdc_dev_pm_ops, + .pm =3D pm_ptr(&msdc_dev_pm_ops), }, }; =20 --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 02554292B52; Fri, 15 Aug 2025 01:55:37 +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=1755222937; cv=none; b=LoFOPgkvq/VzO53OyT4VaSxIu/3L8xUrx+FFuoEmuzsswtRiddZodQWNVgocMiQak+xjarsQGOVhjHzoJ1A7XYQpcBjTZ76pKS/F0aMfWZCqPKlzz9LV2jjL+3K7wJvrYeqKa6mVaTfMKmKJhVuQr8ebKxV9+j/wW+baJYyhykI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222937; c=relaxed/simple; bh=NHJg45Q6RPT/LzftpxYLT2sirlMKoU2PUDsz68Jd5mI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IvMpx7z84Hd2Lhx5c5SdFCUaYQmiRD/zYtpEL8Xb/RZ41RNqam1Vo92PydhavV98/WFcsi/jX0KlB1RwXOM5WPWzmZzWUwEt3PHL7puhTZYH5qAyQeWEbOsdRPxxMypY7y6KUB+jOZlpe/IcE+n3N4D+QOkrWIpjHjgVSPvesuA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=t6Jwa9oA; 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="t6Jwa9oA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFCA1C4CEF5; Fri, 15 Aug 2025 01:55:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222936; bh=NHJg45Q6RPT/LzftpxYLT2sirlMKoU2PUDsz68Jd5mI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t6Jwa9oAl2loRWlaQq4BM/0mXiLm6tdOKqdwld6dQqu0gODg4+zNXfHa+rTroLGB7 8UrOJxC1WKC2P70lYm4b4saRYK1t5Nob/yNNjViViOfUIPaAbOMjMK8ZXlpWT8ao8G /SDobr+9mn9xuTpFWNiyeV05e9SyD21HJWhIc7joNVb1zo/cZ/bj1za7eMz6l7/RiP EH2O5B7nUruj16+ckY0M/MvdYcmm++nPF0K3BoKp+aQQcE6GuxDGrnUjRq//QJUCeF LDFJnp8D8cgxOfXvGS/kIgxdAJT2H/jub54gCzuLo5tdZtenkYlfHpXvfE8X+Zaf+3 Kk+32QhYKXAxw== 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 33/38] mmc: sdhci-msm: use modern PM macros Date: Fri, 15 Aug 2025 09:34:08 +0800 Message-ID: <20250815013413.28641-34-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 __maybe_unused. Signed-off-by: Jisheng Zhang --- drivers/mmc/host/sdhci-msm.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 9d8e20dc8ca1..d2906bf6e598 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -1943,7 +1943,7 @@ static void sdhci_msm_ice_enable(struct sdhci_msm_hos= t *msm_host) qcom_ice_enable(msm_host->ice); } =20 -static __maybe_unused int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_= host) +static int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host) { if (msm_host->mmc->caps2 & MMC_CAP2_CRYPTO) return qcom_ice_resume(msm_host->ice); @@ -1951,7 +1951,7 @@ static __maybe_unused int sdhci_msm_ice_resume(struct= sdhci_msm_host *msm_host) return 0; } =20 -static __maybe_unused int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm= _host) +static int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host) { if (msm_host->mmc->caps2 & MMC_CAP2_CRYPTO) return qcom_ice_suspend(msm_host->ice); @@ -2011,13 +2011,13 @@ static inline void sdhci_msm_ice_enable(struct sdhc= i_msm_host *msm_host) { } =20 -static inline __maybe_unused int +static inline int sdhci_msm_ice_resume(struct sdhci_msm_host *msm_host) { return 0; } =20 -static inline __maybe_unused int +static inline int sdhci_msm_ice_suspend(struct sdhci_msm_host *msm_host) { return 0; @@ -2801,7 +2801,7 @@ static void sdhci_msm_remove(struct platform_device *= pdev) clk_disable_unprepare(msm_host->bus_clk); } =20 -static __maybe_unused int sdhci_msm_runtime_suspend(struct device *dev) +static int sdhci_msm_runtime_suspend(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -2820,7 +2820,7 @@ static __maybe_unused int sdhci_msm_runtime_suspend(s= truct device *dev) return sdhci_msm_ice_suspend(msm_host); } =20 -static __maybe_unused int sdhci_msm_runtime_resume(struct device *dev) +static int sdhci_msm_runtime_resume(struct device *dev) { struct sdhci_host *host =3D dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host =3D sdhci_priv(host); @@ -2856,11 +2856,8 @@ static __maybe_unused int sdhci_msm_runtime_resume(s= truct device *dev) } =20 static const struct dev_pm_ops sdhci_msm_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, - sdhci_msm_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(sdhci_msm_runtime_suspend, sdhci_msm_runtime_resume, NULL) }; =20 static struct platform_driver sdhci_msm_driver =3D { @@ -2869,7 +2866,7 @@ static struct platform_driver sdhci_msm_driver =3D { .driver =3D { .name =3D "sdhci_msm", .of_match_table =3D sdhci_msm_dt_match, - .pm =3D &sdhci_msm_pm_ops, + .pm =3D pm_ptr(&sdhci_msm_pm_ops), .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, }, }; --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 94BB2298CB6; Fri, 15 Aug 2025 01:55:44 +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=1755222944; cv=none; b=FKcpIsO1v6penvgeGeSFo7/vkTb9jVWxOzkCvUzMDssQTiUm4PNI8/z3tpKx2HY23PzT3/jIny1y01aGaMMHVVnf0rnGJp+trO4ugXCO9+ZDxz9r7Ofy8uRTDlHShz7YF0ZMo6CddEg97VVtvWfjhSs33/x2qGrXeqVqhj7XRwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222944; c=relaxed/simple; bh=Z/FsofMY227WloXvAvWVR10i7/zLGg3QA6StyCVCXTQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TIpImdMsBnb8/d8kUg0Qz2vLLxqXmPB58nWr/BSjuX8jLO5zkvm+UmQUtCCZTjFqmOjAU4UZ7IH0Be9DtwegDoRpvAPuo4dUErdld3473uq6htT5zbYR1n1YwsiLtD1lGpQk4aW8qWfJXnLlarQeO+sJ73njQ8iGATYGmZ3Z04E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OW/j3RE4; 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="OW/j3RE4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 44606C4CEED; Fri, 15 Aug 2025 01:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222944; bh=Z/FsofMY227WloXvAvWVR10i7/zLGg3QA6StyCVCXTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OW/j3RE4gSC9rK+tSuZ57U4rHnlmxISJot7EpnrpDrgOouzGgNFk0UOcaErlsTQ6d uX0IVq4zSSDaG47TOF6/qi/j+8Z+uduZj8w3nD3F+8R/08UkGYAyFiCYGFkpEA6y9w /awaCZrSKl6HBt4QNue6ZHhnMo43QJY4yEdHkntbeLCTwRSCJa9SJ6j3UhnkBhGBH4 7AS2D8V5V+LzAFWtn9E4vT1E6F+yKnL76IujTBTzcESQftqBo7OMsYVscPcE8Kl8SZ TitK2vHcs58qXiuo0sQC67BuAU3YvFWNLF1xp479XGhhrXBK2zK1JscwcoRRT6yis3 Zw0xfYV55Uc0g== 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 34/38] mmc: via-sdmmc: use modern PM macros Date: Fri, 15 Aug 2025 09:34:09 +0800 Message-ID: <20250815013413.28641-35-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 __maybe_unused. Signed-off-by: Jisheng Zhang --- drivers/mmc/host/via-sdmmc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/via-sdmmc.c b/drivers/mmc/host/via-sdmmc.c index 3bd49f64899d..c628b3bbfd7a 100644 --- a/drivers/mmc/host/via-sdmmc.c +++ b/drivers/mmc/host/via-sdmmc.c @@ -1218,7 +1218,7 @@ static void via_sd_remove(struct pci_dev *pcidev) pci_name(pcidev), (int)pcidev->vendor, (int)pcidev->device); } =20 -static void __maybe_unused via_init_sdc_pm(struct via_crdr_mmc_host *host) +static void via_init_sdc_pm(struct via_crdr_mmc_host *host) { struct sdhcreg *pm_sdhcreg; void __iomem *addrbase; @@ -1252,7 +1252,7 @@ static void __maybe_unused via_init_sdc_pm(struct via= _crdr_mmc_host *host) via_print_sdchc(host); } =20 -static int __maybe_unused via_sd_suspend(struct device *dev) +static int via_sd_suspend(struct device *dev) { struct via_crdr_mmc_host *host; unsigned long flags; @@ -1269,7 +1269,7 @@ static int __maybe_unused via_sd_suspend(struct devic= e *dev) return 0; } =20 -static int __maybe_unused via_sd_resume(struct device *dev) +static int via_sd_resume(struct device *dev) { struct via_crdr_mmc_host *sdhost; u8 gatt; @@ -1295,14 +1295,14 @@ static int __maybe_unused via_sd_resume(struct devi= ce *dev) return 0; } =20 -static SIMPLE_DEV_PM_OPS(via_sd_pm_ops, via_sd_suspend, via_sd_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(via_sd_pm_ops, via_sd_suspend, via_sd_resu= me); =20 static struct pci_driver via_sd_driver =3D { .name =3D DRV_NAME, .id_table =3D via_ids, .probe =3D via_sd_probe, .remove =3D via_sd_remove, - .driver.pm =3D &via_sd_pm_ops, + .driver.pm =3D pm_sleep_ptr(&via_sd_pm_ops), }; =20 module_pci_driver(via_sd_driver); --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 DA41029B8CE; Fri, 15 Aug 2025 01:55:51 +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=1755222951; cv=none; b=N7/qF1MzQy298ephewI10hJsGGNpF/LoegX1vQEu6tYKyp8op2Xpo8Xyu2EnBee60Q8aTi5ExcsodWPCJJbKM9sGDROvapw3z8EX3gaOqnmsSM87q9bL6IPWKbmrk0Sqo3BhRbEB/Hl1UmgoQm5THb4DYtnLYI3fH3jr6wwrUkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222951; c=relaxed/simple; bh=fCpU2z9tS/VV7L6nfg3/4EK4ZZ3KWPbuidPRnhC6sbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CSHF9zZ0VyD3AF2uPIVgtsUPl6G0yM/DEBleS103ZRxMh0iYvZWpSqKnDJDuXKWYAS9CxYS7cxE2Lsj1YVJ/TyjzKG8ta3nKlnMLnIkIzM1FRGAg72cTekmxvBeP4iyYxWX9NzfNkYNuKtddSPhaHI+6PkqcR6h5DXVEv5BVXuA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ofl++gEF; 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="Ofl++gEF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F74AC4CEF1; Fri, 15 Aug 2025 01:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222951; bh=fCpU2z9tS/VV7L6nfg3/4EK4ZZ3KWPbuidPRnhC6sbQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ofl++gEF8hDD1BiUk0L5kOrL3tmhCQRcx7V73vE/h/nvVo/61aJ5OTvX1YpHhWvbC o/keqG0LYNNdk4ryh7WJ8rPWlIUSJIZm99vL+wo7NhM+MYHhYQi2OgHsBxCpg6ite7 KU23jZIXTt0IuKaRXeOMK20TNAJgMpNvrCcXwwmo4XhfC/ErDCZaVoQqITO+ks6/rH wF5z9CUJMsmJRbBl6hConr4BTq67ZDKm8iyfyS4GcS53Ijoe7p5+QTiN30lZyX8CWG hrhZKfODN/o8inMGwinl/8hAwAk5wil9OLfUn5IaEwwVuBSvFE/nUwWNLkErF3NrBf C+J2Ob8jeRo9g== 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 35/38] mmc: dw_mmc: exynos: use modern PM macros Date: Fri, 15 Aug 2025 09:34:10 +0800 Message-ID: <20250815013413.28641-36-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/dw_mmc-exynos.c | 13 +++---------- drivers/mmc/host/dw_mmc.h | 3 +++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exy= nos.c index e3548408ca39..384609671a9a 100644 --- a/drivers/mmc/host/dw_mmc-exynos.c +++ b/drivers/mmc/host/dw_mmc-exynos.c @@ -189,7 +189,6 @@ static void dw_mci_exynos_set_clksel_timing(struct dw_m= ci *host, u32 timing) set_bit(DW_MMC_CARD_NO_USE_HOLD, &host->slot->flags); } =20 -#ifdef CONFIG_PM static int dw_mci_exynos_runtime_resume(struct device *dev) { struct dw_mci *host =3D dev_get_drvdata(dev); @@ -203,9 +202,7 @@ static int dw_mci_exynos_runtime_resume(struct device *= dev) =20 return ret; } -#endif /* CONFIG_PM */ =20 -#ifdef CONFIG_PM_SLEEP /** * dw_mci_exynos_suspend_noirq - Exynos-specific suspend code * @dev: Device to suspend (this device) @@ -265,7 +262,6 @@ static int dw_mci_exynos_resume_noirq(struct device *de= v) =20 return 0; } -#endif /* CONFIG_PM_SLEEP */ =20 static void dw_mci_exynos_config_hs400(struct dw_mci *host, u32 timing) { @@ -712,11 +708,8 @@ static void dw_mci_exynos_remove(struct platform_devic= e *pdev) } =20 static const struct dev_pm_ops dw_mci_exynos_pmops =3D { - SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(dw_mci_exynos_suspend_noirq, - dw_mci_exynos_resume_noirq) - SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend, - dw_mci_exynos_runtime_resume, - NULL) + NOIRQ_SYSTEM_SLEEP_PM_OPS(dw_mci_exynos_suspend_noirq, dw_mci_exynos_resu= me_noirq) + RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_exynos_runtime_resume, NULL) }; =20 static struct platform_driver dw_mci_exynos_pltfm_driver =3D { @@ -726,7 +719,7 @@ static struct platform_driver dw_mci_exynos_pltfm_drive= r =3D { .name =3D "dwmmc_exynos", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D dw_mci_exynos_match, - .pm =3D &dw_mci_exynos_pmops, + .pm =3D pm_ptr(&dw_mci_exynos_pmops), }, }; =20 diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 5463392dc811..588027932412 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -541,6 +541,9 @@ extern void dw_mci_remove(struct dw_mci *host); #ifdef CONFIG_PM extern int dw_mci_runtime_suspend(struct device *device); extern int dw_mci_runtime_resume(struct device *device); +#else +static inline int dw_mci_runtime_suspend(struct device *device) { return -= EOPNOTSUPP; } +static inline int dw_mci_runtime_resume(struct device *device) { return -E= OPNOTSUPP; } #endif =20 /** --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 48829293B48; Fri, 15 Aug 2025 01:55:58 +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=1755222959; cv=none; b=dMFwzY+dvd6KGwkvHqdqg5A6pth/Ij6+e3TaFE5f0m/R/LddJEyAAfB6F3IMNfr7LfW22YD7d7cpMo/u+LxuMqvBaNcZRFW13ax5NV0j3IXhzNKtlkhoxti7eHdoykbSJ5WY/fPZqnDud3DjXqohGeSgAB9OtFfXguRNdaFlv1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222959; c=relaxed/simple; bh=SIss+Xq9xiCpCrynk679o+RdenprEBRwz+hH338Ojlg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ys8J0p7kkGBgFrr5MiSfqgDaTkMojanDNOf9enIh8obvDxgBzedpHKx5TbEuaJPCZ5vNUu+64WkTbMn1iQCygPDOigEDnaqFJpwY7+XlqsOqwU/cWrWJ/8vvh/Hj8TPiJ1kYzLF0D5N+Oy8KJ7MbKwf3wdABDwO/MenySfr4IOI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nu3uUEPv; 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="Nu3uUEPv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC483C4CEED; Fri, 15 Aug 2025 01:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222958; bh=SIss+Xq9xiCpCrynk679o+RdenprEBRwz+hH338Ojlg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nu3uUEPvDKZYNvpRCDPhmrJNU0YmBfMf+A53OGCsvdkcf6CS4W7ghMcUUPi9wJV23 /spz7TwWfq0frPoyrDrFLiIoLsVDfRgTaZcZAx2WFOL6JYmDMorB3EuM3VaZxetlLa wF5wxJqjzLDoy5A2c8sWYQuCV1LChIinQi5t56mgR1qH0zimPAaaylca/Y0vLupkoA icIovZOPsLDAfle5m8W8X5g3jo0X7OwCPHw6rB+EiiJSEraPITz/sziV1QoVwI/z0g 3SgGsE2m0JIhwSBbyd8MVwwch58Na46k7Jmqjr5KnrzFL4IV6Q74R048WlUkS4G8sb gopLqcWnV0VVQ== 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 36/38] mmc: dw_mmc-k3: use modern PM macros Date: Fri, 15 Aug 2025 09:34:11 +0800 Message-ID: <20250815013413.28641-37-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/dw_mmc-k3.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c index 0311a37dd4ab..ad6aa1aea549 100644 --- a/drivers/mmc/host/dw_mmc-k3.c +++ b/drivers/mmc/host/dw_mmc-k3.c @@ -461,11 +461,8 @@ static int dw_mci_k3_probe(struct platform_device *pde= v) } =20 static const struct dev_pm_ops dw_mci_k3_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend, - dw_mci_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL) }; =20 static struct platform_driver dw_mci_k3_pltfm_driver =3D { @@ -475,7 +472,7 @@ static struct platform_driver dw_mci_k3_pltfm_driver = =3D { .name =3D "dwmmc_k3", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D dw_mci_k3_match, - .pm =3D &dw_mci_k3_dev_pm_ops, + .pm =3D pm_ptr(&dw_mci_k3_dev_pm_ops), }, }; =20 --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 81EE429993B; Fri, 15 Aug 2025 01:56:06 +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=1755222966; cv=none; b=UlYvrV2bWb4/cLh3qY4wsR2ubUcK0aQcrAOGZ29THb+7I3ESCIXzZIm/vHS8Uu2FXtRpbJRIRD04PRP7ostaWBBUJzM8HS5KUkqvDwdKZOPfUCfzbGeqFYjzjlaHqzR53CcF9gAzOtWRf09i6vg4UR7V4TD0ibz8rbZei7BBsPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222966; c=relaxed/simple; bh=Uv4u50M4AilsmnclSV3mx2m8PHaUQmh87HAbah/c+J8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pmcyp5TIMbjgLEeztHMeyv1qj+bp9ridBjBosPU2esd9CO5Dj9YkOR9YJv2hkAmlTplEsMknIgyvZH0wdfJnX+Mf5qzlbp/cpLYspap9Gb/cONTNpx+umdZ/TJA54uroK571iGKWM0m55RTjoIbgTUMPOOkjteNJjBmCrtis2xE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jt8IjIFA; 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="Jt8IjIFA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 341E6C4CEF1; Fri, 15 Aug 2025 01:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222966; bh=Uv4u50M4AilsmnclSV3mx2m8PHaUQmh87HAbah/c+J8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jt8IjIFAeAOsvwdVIzDZKDiZatNL33niufHsAHPVmWrxuNHHMWMXjWW9o6M2BPgDi HX65FJ5SQvjp7mVpByb4Oj4KdaxZhxVuQJ+PYti9/8OsBgAuGkqocS7w66pn6AyGLV jUqftc7oiSV0Ef9ECtr6d9+g+S0t/D0ThZwRnLv5+w5vUunAegz/fycsbjaW6f9oSC xQvy/K51Gn9KN2M2LOjfTsRErrmHg7rJHoDevqjB6G470p2nB5dwuedMr6xLQq7SxC RbSYNc2jelAB8tICh0W+1Qh4YEebwUbJpjhtmHdVj6JRwsM2NXO2vyfclVElmORtX5 Yek5Ol9IUOYag== 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 37/38] mmc: dw_mmc-pci: use modern PM macros Date: Fri, 15 Aug 2025 09:34:12 +0800 Message-ID: <20250815013413.28641-38-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/dw_mmc-pci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-pci.c b/drivers/mmc/host/dw_mmc-pci.c index e7ab699f488e..092cc99175af 100644 --- a/drivers/mmc/host/dw_mmc-pci.c +++ b/drivers/mmc/host/dw_mmc-pci.c @@ -75,11 +75,8 @@ static void dw_mci_pci_remove(struct pci_dev *pdev) } =20 static const struct dev_pm_ops dw_mci_pci_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend, - dw_mci_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL) }; =20 static const struct pci_device_id dw_mci_pci_id[] =3D { @@ -94,7 +91,7 @@ static struct pci_driver dw_mci_pci_driver =3D { .probe =3D dw_mci_pci_probe, .remove =3D dw_mci_pci_remove, .driver =3D { - .pm =3D &dw_mci_pci_dev_pm_ops, + .pm =3D pm_ptr(&dw_mci_pci_dev_pm_ops), }, }; =20 --=20 2.50.0 From nobody Sat Oct 4 14:32:49 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 8940C2951B3; Fri, 15 Aug 2025 01:56:13 +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=1755222973; cv=none; b=nNgxVUXt/X5NK8dms7r/6yqzXfJCk/LVWyzwPBUI1QS1Ib7irw3sgBgNiItOlPIN9Aqw2qSpF7S1Tp5+/YkGwKluq1It1T26rU+d4U8nn/EB1pXeb+XeLB9f0Ep1ftR/mCyGTSjuAYxOM0SYoU29DniKbYE4+vgt+hP+bDMbXIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755222973; c=relaxed/simple; bh=r/j8FaIOvHUYrSEe5Yr0T8P9WzL2BKrKUkvkK+hcizQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=La4ypF1gTexseIl+z/z12xbPtVYLMnn1hAQSoNDyGzvOnvoEL4PN66x//7v8WlHI+/pfXisppbEzG8gzk2mvYs0Va7KPCV8itKvMAslyByVap/IeuaHqJ5yNG3er2q+6ZyojN1+B76bPTzHmd63HVARrNeLG6c6cUgd/4gAW6k8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nG+EwLlE; 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="nG+EwLlE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 811A0C4CEF5; Fri, 15 Aug 2025 01:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755222973; bh=r/j8FaIOvHUYrSEe5Yr0T8P9WzL2BKrKUkvkK+hcizQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nG+EwLlEJOhkwuCwR6X5CqG6huU2//edIzsEpPaK5k27aHrGoBksw17Y4x53bOrOQ Ex/wVnzSdM55Lu49HULItlCvlvdkc8S63fdLwIO4UFNHJDxnl2pFKaDaigC61tV8km 9Ogophhy4DWeXTr/804dsoMvXp2clmI44j52XUUepDa6ud7Ty50aT0pHOo9k1nicoP r4HAb3RzaK71qbLu9GRxQeN3LtV3DVp2GuHaqy4Yf6iDKyp8SdPWa0h7Q8S38YvwbJ v2/2QX92Aox72R1uFo19SfbUnph3UD8V8MGb+I5ouwNU1TGQMHkveZxGneDAdqRx2S Y9HAjH4avYWaQ== 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 38/38] mmc: dw_mmc-rockchip: use modern PM macros Date: Fri, 15 Aug 2025 09:34:13 +0800 Message-ID: <20250815013413.28641-39-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/dw_mmc-rockchip.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-r= ockchip.c index baa23b517731..d2aec6cf9773 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -568,11 +568,8 @@ static void dw_mci_rockchip_remove(struct platform_dev= ice *pdev) } =20 static const struct dev_pm_ops dw_mci_rockchip_dev_pm_ops =3D { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(dw_mci_runtime_suspend, - dw_mci_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) + RUNTIME_PM_OPS(dw_mci_runtime_suspend, dw_mci_runtime_resume, NULL) }; =20 static struct platform_driver dw_mci_rockchip_pltfm_driver =3D { @@ -582,7 +579,7 @@ static struct platform_driver dw_mci_rockchip_pltfm_dri= ver =3D { .name =3D "dwmmc_rockchip", .probe_type =3D PROBE_PREFER_ASYNCHRONOUS, .of_match_table =3D dw_mci_rockchip_match, - .pm =3D &dw_mci_rockchip_dev_pm_ops, + .pm =3D pm_ptr(&dw_mci_rockchip_dev_pm_ops), }, }; =20 --=20 2.50.0