Skip to content

Commit f318315

Browse files
jic23dtor
authored andcommitted
Input: pxspad - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against used function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 56232e9 commit f318315

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/input/joystick/psxpad-spi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ static int psxpad_spi_probe(struct spi_device *spi)
371371
return 0;
372372
}
373373

374-
static int __maybe_unused psxpad_spi_suspend(struct device *dev)
374+
static int psxpad_spi_suspend(struct device *dev)
375375
{
376376
struct spi_device *spi = to_spi_device(dev);
377377
struct psxpad *pad = spi_get_drvdata(spi);
@@ -381,7 +381,7 @@ static int __maybe_unused psxpad_spi_suspend(struct device *dev)
381381
return 0;
382382
}
383383

384-
static SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
384+
static DEFINE_SIMPLE_DEV_PM_OPS(psxpad_spi_pm, psxpad_spi_suspend, NULL);
385385

386386
static const struct spi_device_id psxpad_spi_id[] = {
387387
{ "psxpad-spi", 0 },
@@ -392,7 +392,7 @@ MODULE_DEVICE_TABLE(spi, psxpad_spi_id);
392392
static struct spi_driver psxpad_spi_driver = {
393393
.driver = {
394394
.name = "psxpad-spi",
395-
.pm = &psxpad_spi_pm,
395+
.pm = pm_sleep_ptr(&psxpad_spi_pm),
396396
},
397397
.id_table = psxpad_spi_id,
398398
.probe = psxpad_spi_probe,

0 commit comments

Comments
 (0)