Skip to content

Commit ac99b12

Browse files
Uwe Kleine-Königdlezcano
authored andcommitted
thermal: amlogic: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions
This macro has the advantage over SIMPLE_DEV_PM_OPS that we don't have to care about when the functions are actually used, so the corresponding __maybe_unused can be dropped. Also make use of pm_ptr() to discard all PM related stuff if CONFIG_PM isn't enabled. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 720f8db commit ac99b12

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/thermal/amlogic_thermal.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static void amlogic_thermal_remove(struct platform_device *pdev)
296296
amlogic_thermal_disable(data);
297297
}
298298

299-
static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
299+
static int amlogic_thermal_suspend(struct device *dev)
300300
{
301301
struct amlogic_thermal *data = dev_get_drvdata(dev);
302302

@@ -305,20 +305,21 @@ static int __maybe_unused amlogic_thermal_suspend(struct device *dev)
305305
return 0;
306306
}
307307

308-
static int __maybe_unused amlogic_thermal_resume(struct device *dev)
308+
static int amlogic_thermal_resume(struct device *dev)
309309
{
310310
struct amlogic_thermal *data = dev_get_drvdata(dev);
311311

312312
return amlogic_thermal_enable(data);
313313
}
314314

315-
static SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops,
316-
amlogic_thermal_suspend, amlogic_thermal_resume);
315+
static DEFINE_SIMPLE_DEV_PM_OPS(amlogic_thermal_pm_ops,
316+
amlogic_thermal_suspend,
317+
amlogic_thermal_resume);
317318

318319
static struct platform_driver amlogic_thermal_driver = {
319320
.driver = {
320321
.name = "amlogic_thermal",
321-
.pm = &amlogic_thermal_pm_ops,
322+
.pm = pm_ptr(&amlogic_thermal_pm_ops),
322323
.of_match_table = of_amlogic_thermal_match,
323324
},
324325
.probe = amlogic_thermal_probe,

0 commit comments

Comments
 (0)