Skip to content

Commit 353fdae

Browse files
xhackerustcBartosz Golaszewski
authored andcommitted
gpio: xgene: 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 __maybe_unused Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Link: https://lore.kernel.org/r/20251124002105.25429-13-jszhang@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 46e90d3 commit 353fdae

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpio/gpio-xgene.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc,
130130
return 0;
131131
}
132132

133-
static __maybe_unused int xgene_gpio_suspend(struct device *dev)
133+
static int xgene_gpio_suspend(struct device *dev)
134134
{
135135
struct xgene_gpio *gpio = dev_get_drvdata(dev);
136136
unsigned long bank_offset;
@@ -143,7 +143,7 @@ static __maybe_unused int xgene_gpio_suspend(struct device *dev)
143143
return 0;
144144
}
145145

146-
static __maybe_unused int xgene_gpio_resume(struct device *dev)
146+
static int xgene_gpio_resume(struct device *dev)
147147
{
148148
struct xgene_gpio *gpio = dev_get_drvdata(dev);
149149
unsigned long bank_offset;
@@ -156,7 +156,7 @@ static __maybe_unused int xgene_gpio_resume(struct device *dev)
156156
return 0;
157157
}
158158

159-
static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
159+
static DEFINE_SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
160160

161161
static int xgene_gpio_probe(struct platform_device *pdev)
162162
{
@@ -204,7 +204,7 @@ static struct platform_driver xgene_gpio_driver = {
204204
.name = "xgene-gpio",
205205
.of_match_table = xgene_gpio_of_match,
206206
.acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match),
207-
.pm = &xgene_gpio_pm,
207+
.pm = pm_sleep_ptr(&xgene_gpio_pm),
208208
},
209209
.probe = xgene_gpio_probe,
210210
};

0 commit comments

Comments
 (0)