mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 02:33:57 +00:00
iio: chemical: scd30: Export dev_pm_ops instead of suspend() and resume()
Whilst here move to the new infrastructure using pm_sleep_ptr() and EXPORT_DEV_PM_OPS() so as to let the compiler remove the unused code if CONFIG_SLEEP is not defined. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Tomasz Duszynski <tomasz.duszynski@octakon.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
3123109284
commit
95d5a7214b
@ -68,10 +68,7 @@ struct scd30_state {
|
||||
scd30_command_t command;
|
||||
};
|
||||
|
||||
int scd30_suspend(struct device *dev);
|
||||
int scd30_resume(struct device *dev);
|
||||
|
||||
static __maybe_unused SIMPLE_DEV_PM_OPS(scd30_pm_ops, scd30_suspend, scd30_resume);
|
||||
extern const struct dev_pm_ops scd30_pm_ops;
|
||||
|
||||
int scd30_probe(struct device *dev, int irq, const char *name, void *priv, scd30_command_t command);
|
||||
|
||||
|
@ -517,7 +517,7 @@ static const struct iio_chan_spec scd30_channels[] = {
|
||||
IIO_CHAN_SOFT_TIMESTAMP(3),
|
||||
};
|
||||
|
||||
int __maybe_unused scd30_suspend(struct device *dev)
|
||||
static int scd30_suspend(struct device *dev)
|
||||
{
|
||||
struct iio_dev *indio_dev = dev_get_drvdata(dev);
|
||||
struct scd30_state *state = iio_priv(indio_dev);
|
||||
@ -529,9 +529,8 @@ int __maybe_unused scd30_suspend(struct device *dev)
|
||||
|
||||
return regulator_disable(state->vdd);
|
||||
}
|
||||
EXPORT_SYMBOL(scd30_suspend);
|
||||
|
||||
int __maybe_unused scd30_resume(struct device *dev)
|
||||
static int scd30_resume(struct device *dev)
|
||||
{
|
||||
struct iio_dev *indio_dev = dev_get_drvdata(dev);
|
||||
struct scd30_state *state = iio_priv(indio_dev);
|
||||
@ -543,7 +542,8 @@ int __maybe_unused scd30_resume(struct device *dev)
|
||||
|
||||
return scd30_command_write(state, CMD_START_MEAS, state->pressure_comp);
|
||||
}
|
||||
EXPORT_SYMBOL(scd30_resume);
|
||||
|
||||
EXPORT_SIMPLE_DEV_PM_OPS(scd30_pm_ops, scd30_suspend, scd30_resume);
|
||||
|
||||
static void scd30_stop_meas(void *data)
|
||||
{
|
||||
|
@ -128,7 +128,7 @@ static struct i2c_driver scd30_i2c_driver = {
|
||||
.driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
.of_match_table = scd30_i2c_of_match,
|
||||
.pm = &scd30_pm_ops,
|
||||
.pm = pm_sleep_ptr(&scd30_pm_ops),
|
||||
},
|
||||
.probe_new = scd30_i2c_probe,
|
||||
};
|
||||
|
@ -252,7 +252,7 @@ static struct serdev_device_driver scd30_serdev_driver = {
|
||||
.driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
.of_match_table = scd30_serdev_of_match,
|
||||
.pm = &scd30_pm_ops,
|
||||
.pm = pm_sleep_ptr(&scd30_pm_ops),
|
||||
},
|
||||
.probe = scd30_serdev_probe,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user