Skip to content

Commit 655231d

Browse files
jic23groeck
authored andcommitted
hwmon: (w83627ehf) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
These newer PM macros allow the compiler to see what code it can remove if !CONFIG_PM_SLEEP. This allows the removal of __maybe_unused markings whilst achieving the same result. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 1efe2b2 commit 655231d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/hwmon/w83627ehf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ static int __init w83627ehf_probe(struct platform_device *pdev)
19441944
return PTR_ERR_OR_ZERO(hwmon_dev);
19451945
}
19461946

1947-
static int __maybe_unused w83627ehf_suspend(struct device *dev)
1947+
static int w83627ehf_suspend(struct device *dev)
19481948
{
19491949
struct w83627ehf_data *data = w83627ehf_update_device(dev);
19501950

@@ -1955,7 +1955,7 @@ static int __maybe_unused w83627ehf_suspend(struct device *dev)
19551955
return 0;
19561956
}
19571957

1958-
static int __maybe_unused w83627ehf_resume(struct device *dev)
1958+
static int w83627ehf_resume(struct device *dev)
19591959
{
19601960
struct w83627ehf_data *data = dev_get_drvdata(dev);
19611961
int i;
@@ -2010,12 +2010,12 @@ static int __maybe_unused w83627ehf_resume(struct device *dev)
20102010
return 0;
20112011
}
20122012

2013-
static SIMPLE_DEV_PM_OPS(w83627ehf_dev_pm_ops, w83627ehf_suspend, w83627ehf_resume);
2013+
static DEFINE_SIMPLE_DEV_PM_OPS(w83627ehf_dev_pm_ops, w83627ehf_suspend, w83627ehf_resume);
20142014

20152015
static struct platform_driver w83627ehf_driver = {
20162016
.driver = {
20172017
.name = DRVNAME,
2018-
.pm = &w83627ehf_dev_pm_ops,
2018+
.pm = pm_sleep_ptr(&w83627ehf_dev_pm_ops),
20192019
},
20202020
};
20212021

0 commit comments

Comments
 (0)