]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: via-sdmmc: use modern PM macros
authorJisheng Zhang <jszhang@kernel.org>
Fri, 15 Aug 2025 01:34:09 +0000 (09:34 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 22 Aug 2025 10:14:05 +0000 (12:14 +0200)
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 <jszhang@kernel.org>
Link: https://lore.kernel.org/r/20250815013413.28641-35-jszhang@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/via-sdmmc.c

index 3bd49f64899d62d253701dd2a8d94497e2ed777d..c628b3bbfd7aad7508f7e96c1c5891fe69c327ba 100644 (file)
@@ -1218,7 +1218,7 @@ static void via_sd_remove(struct pci_dev *pcidev)
                pci_name(pcidev), (int)pcidev->vendor, (int)pcidev->device);
 }
 
-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);
 }
 
-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 device *dev)
        return 0;
 }
 
-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 device *dev)
        return 0;
 }
 
-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_resume);
 
 static struct pci_driver via_sd_driver = {
        .name = DRV_NAME,
        .id_table = via_ids,
        .probe = via_sd_probe,
        .remove = via_sd_remove,
-       .driver.pm = &via_sd_pm_ops,
+       .driver.pm = pm_sleep_ptr(&via_sd_pm_ops),
 };
 
 module_pci_driver(via_sd_driver);