Skip to content

Commit 7bb732f

Browse files
hesham-huaweirafaeljw
authored andcommitted
thermal: hisi_termal: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Cleaning up the driver to use pm_sleep_ptr() macro instead of #ifdef guards is simpler and allows the compiler to remove those functions if built without CONFIG_PM_SLEEP support. Signed-off-by: Hesham Almatary <[email protected]> Reviewed-by: Paul Cercueil <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent ce522ba commit 7bb732f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/thermal/hisi_thermal.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ static int hisi_thermal_remove(struct platform_device *pdev)
629629
return 0;
630630
}
631631

632-
#ifdef CONFIG_PM_SLEEP
633632
static int hisi_thermal_suspend(struct device *dev)
634633
{
635634
struct hisi_thermal_data *data = dev_get_drvdata(dev);
@@ -651,15 +650,14 @@ static int hisi_thermal_resume(struct device *dev)
651650

652651
return ret;
653652
}
654-
#endif
655653

656-
static SIMPLE_DEV_PM_OPS(hisi_thermal_pm_ops,
654+
static DEFINE_SIMPLE_DEV_PM_OPS(hisi_thermal_pm_ops,
657655
hisi_thermal_suspend, hisi_thermal_resume);
658656

659657
static struct platform_driver hisi_thermal_driver = {
660658
.driver = {
661659
.name = "hisi_thermal",
662-
.pm = &hisi_thermal_pm_ops,
660+
.pm = pm_sleep_ptr(&hisi_thermal_pm_ops),
663661
.of_match_table = of_hisi_thermal_match,
664662
},
665663
.probe = hisi_thermal_probe,

0 commit comments

Comments
 (0)