Skip to content

Commit df660f6

Browse files
committed
pinctrl: baytrail: Make use of pm_ptr()
Cleaning up the driver to use pm_ptr() and *_PM_OPS() macros that make it simpler and allows the compiler to remove those functions if built without CONFIG_PM and CONFIG_PM_SLEEP support. Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20230717172821.62827-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 34393c3 commit df660f6

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

drivers/pinctrl/intel/pinctrl-baytrail.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,6 @@ static int byt_pinctrl_probe(struct platform_device *pdev)
16591659
return 0;
16601660
}
16611661

1662-
#ifdef CONFIG_PM_SLEEP
16631662
static int byt_gpio_suspend(struct device *dev)
16641663
{
16651664
struct intel_pinctrl *vg = dev_get_drvdata(dev);
@@ -1743,9 +1742,7 @@ static int byt_gpio_resume(struct device *dev)
17431742
raw_spin_unlock_irqrestore(&byt_lock, flags);
17441743
return 0;
17451744
}
1746-
#endif
17471745

1748-
#ifdef CONFIG_PM
17491746
static int byt_gpio_runtime_suspend(struct device *dev)
17501747
{
17511748
return 0;
@@ -1755,19 +1752,17 @@ static int byt_gpio_runtime_resume(struct device *dev)
17551752
{
17561753
return 0;
17571754
}
1758-
#endif
17591755

17601756
static const struct dev_pm_ops byt_gpio_pm_ops = {
1761-
SET_LATE_SYSTEM_SLEEP_PM_OPS(byt_gpio_suspend, byt_gpio_resume)
1762-
SET_RUNTIME_PM_OPS(byt_gpio_runtime_suspend, byt_gpio_runtime_resume,
1763-
NULL)
1757+
LATE_SYSTEM_SLEEP_PM_OPS(byt_gpio_suspend, byt_gpio_resume)
1758+
RUNTIME_PM_OPS(byt_gpio_runtime_suspend, byt_gpio_runtime_resume, NULL)
17641759
};
17651760

17661761
static struct platform_driver byt_gpio_driver = {
17671762
.probe = byt_pinctrl_probe,
17681763
.driver = {
17691764
.name = "byt_gpio",
1770-
.pm = &byt_gpio_pm_ops,
1765+
.pm = pm_ptr(&byt_gpio_pm_ops),
17711766
.acpi_match_table = byt_gpio_acpi_match,
17721767
.suppress_bind_attrs = true,
17731768
},

0 commit comments

Comments
 (0)