mirror of https://github.com/torvalds/linux.git
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>
This commit is contained in:
parent
3f19e57cbf
commit
56f3a6d753
|
|
@ -533,7 +533,6 @@ static void brcmstb_gpio_shutdown(struct platform_device *pdev)
|
||||||
brcmstb_gpio_quiesce(&pdev->dev, false);
|
brcmstb_gpio_quiesce(&pdev->dev, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
|
||||||
static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv,
|
static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv,
|
||||||
struct brcmstb_gpio_bank *bank)
|
struct brcmstb_gpio_bank *bank)
|
||||||
{
|
{
|
||||||
|
|
@ -572,14 +571,9 @@ static int brcmstb_gpio_resume(struct device *dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
#define brcmstb_gpio_suspend NULL
|
|
||||||
#define brcmstb_gpio_resume NULL
|
|
||||||
#endif /* CONFIG_PM_SLEEP */
|
|
||||||
|
|
||||||
static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
|
static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
|
||||||
.suspend_noirq = brcmstb_gpio_suspend,
|
.suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend),
|
||||||
.resume_noirq = brcmstb_gpio_resume,
|
.resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int brcmstb_gpio_probe(struct platform_device *pdev)
|
static int brcmstb_gpio_probe(struct platform_device *pdev)
|
||||||
|
|
@ -755,7 +749,7 @@ static struct platform_driver brcmstb_gpio_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "brcmstb-gpio",
|
.name = "brcmstb-gpio",
|
||||||
.of_match_table = brcmstb_gpio_of_match,
|
.of_match_table = brcmstb_gpio_of_match,
|
||||||
.pm = &brcmstb_gpio_pm_ops,
|
.pm = pm_sleep_ptr(&brcmstb_gpio_pm_ops),
|
||||||
},
|
},
|
||||||
.probe = brcmstb_gpio_probe,
|
.probe = brcmstb_gpio_probe,
|
||||||
.remove = brcmstb_gpio_remove,
|
.remove = brcmstb_gpio_remove,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue