]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
gpio: rcar: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 9 Jul 2025 18:43:59 +0000 (20:43 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Fri, 11 Jul 2025 10:21:03 +0000 (12:21 +0200)
Convert the Renesas R-Car GPIO driver from SIMPLE_DEV_PM_OPS() to
DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().  This lets us drop the
check for CONFIG_PM_SLEEP, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled, while increasing build coverage.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://lore.kernel.org/r/e201140426daacaa799d73e2f76bfd96b6f5718f.1752086619.git.geert+renesas@glider.be
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpio-rcar.c

index 1d121a4275905e09912286d1cdf63bc98d0a5b2f..cd31580effa9037f943490888dfeae77be238cef 100644 (file)
@@ -592,7 +592,6 @@ static void gpio_rcar_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int gpio_rcar_suspend(struct device *dev)
 {
        struct gpio_rcar_priv *p = dev_get_drvdata(dev);
@@ -651,16 +650,16 @@ static int gpio_rcar_resume(struct device *dev)
 
        return 0;
 }
-#endif /* CONFIG_PM_SLEEP*/
 
-static SIMPLE_DEV_PM_OPS(gpio_rcar_pm_ops, gpio_rcar_suspend, gpio_rcar_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(gpio_rcar_pm_ops, gpio_rcar_suspend,
+                               gpio_rcar_resume);
 
 static struct platform_driver gpio_rcar_device_driver = {
        .probe          = gpio_rcar_probe,
        .remove         = gpio_rcar_remove,
        .driver         = {
                .name   = "gpio_rcar",
-               .pm     = &gpio_rcar_pm_ops,
+               .pm     = pm_sleep_ptr(&gpio_rcar_pm_ops),
                .of_match_table = gpio_rcar_of_table,
        }
 };