Skip to content

Commit 8de7295

Browse files
jic23groeck
authored andcommitted
hwmon: (nct6775) 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 <Jonathan.Cameron@huawei.com> Cc: Zoltán Kővágó <dirty.ice.hu@gmail.com> Link: https://lore.kernel.org/r/20220925172759.3573439-13-jic23@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 7756309 commit 8de7295

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/hwmon/nct6775-platform.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ static void nct6791_enable_io_mapping(struct nct6775_sio_data *sio_data)
355355
}
356356
}
357357

358-
static int __maybe_unused nct6775_suspend(struct device *dev)
358+
static int nct6775_suspend(struct device *dev)
359359
{
360360
int err;
361361
u16 tmp;
@@ -386,7 +386,7 @@ static int __maybe_unused nct6775_suspend(struct device *dev)
386386
return err;
387387
}
388388

389-
static int __maybe_unused nct6775_resume(struct device *dev)
389+
static int nct6775_resume(struct device *dev)
390390
{
391391
struct nct6775_data *data = dev_get_drvdata(dev);
392392
struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
@@ -467,7 +467,7 @@ static int __maybe_unused nct6775_resume(struct device *dev)
467467
return err;
468468
}
469469

470-
static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
470+
static DEFINE_SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
471471

472472
static void
473473
nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio_data)
@@ -934,7 +934,7 @@ static int nct6775_platform_probe(struct platform_device *pdev)
934934
static struct platform_driver nct6775_driver = {
935935
.driver = {
936936
.name = DRVNAME,
937-
.pm = &nct6775_dev_pm_ops,
937+
.pm = pm_sleep_ptr(&nct6775_dev_pm_ops),
938938
},
939939
.probe = nct6775_platform_probe,
940940
};

0 commit comments

Comments
 (0)