Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

gpio: brcmstb: Use modern PM macros

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 <jszhang@kernel.org>
Acked-by: Doug Berger <opendmb@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20251124002105.25429-3-jszhang@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Jisheng Zhang and committed by
Bartosz Golaszewski
56f3a6d7 3f19e57c

+3 -9
+3 -9
drivers/gpio/gpio-brcmstb.c
··· 533 533 brcmstb_gpio_quiesce(&pdev->dev, false); 534 534 } 535 535 536 - #ifdef CONFIG_PM_SLEEP 537 536 static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv, 538 537 struct brcmstb_gpio_bank *bank) 539 538 { ··· 571 572 return 0; 572 573 } 573 574 574 - #else 575 - #define brcmstb_gpio_suspend NULL 576 - #define brcmstb_gpio_resume NULL 577 - #endif /* CONFIG_PM_SLEEP */ 578 - 579 575 static const struct dev_pm_ops brcmstb_gpio_pm_ops = { 580 - .suspend_noirq = brcmstb_gpio_suspend, 581 - .resume_noirq = brcmstb_gpio_resume, 576 + .suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend), 577 + .resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume), 582 578 }; 583 579 584 580 static int brcmstb_gpio_probe(struct platform_device *pdev) ··· 749 755 .driver = { 750 756 .name = "brcmstb-gpio", 751 757 .of_match_table = brcmstb_gpio_of_match, 752 - .pm = &brcmstb_gpio_pm_ops, 758 + .pm = pm_sleep_ptr(&brcmstb_gpio_pm_ops), 753 759 }, 754 760 .probe = brcmstb_gpio_probe, 755 761 .remove = brcmstb_gpio_remove,