Skip to content

Commit

Permalink
hwmon: (nct6775) Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Browse files Browse the repository at this point in the history
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]>
Cc: Zoltán Kővágó <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>
  • Loading branch information
jic23 authored and groeck committed Sep 25, 2022
1 parent 7756309 commit 8de7295
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hwmon/nct6775-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static void nct6791_enable_io_mapping(struct nct6775_sio_data *sio_data)
}
}

static int __maybe_unused nct6775_suspend(struct device *dev)
static int nct6775_suspend(struct device *dev)
{
int err;
u16 tmp;
Expand Down Expand Up @@ -386,7 +386,7 @@ static int __maybe_unused nct6775_suspend(struct device *dev)
return err;
}

static int __maybe_unused nct6775_resume(struct device *dev)
static int nct6775_resume(struct device *dev)
{
struct nct6775_data *data = dev_get_drvdata(dev);
struct nct6775_sio_data *sio_data = dev_get_platdata(dev);
Expand Down Expand Up @@ -467,7 +467,7 @@ static int __maybe_unused nct6775_resume(struct device *dev)
return err;
}

static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
static DEFINE_SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);

static void
nct6775_check_fan_inputs(struct nct6775_data *data, struct nct6775_sio_data *sio_data)
Expand Down Expand Up @@ -934,7 +934,7 @@ static int nct6775_platform_probe(struct platform_device *pdev)
static struct platform_driver nct6775_driver = {
.driver = {
.name = DRVNAME,
.pm = &nct6775_dev_pm_ops,
.pm = pm_sleep_ptr(&nct6775_dev_pm_ops),
},
.probe = nct6775_platform_probe,
};
Expand Down

0 comments on commit 8de7295

Please sign in to comment.