Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: iio: adt7316: modernize power management

Replaced use of deprecated function SIMPLE_DEV_PM_OPS() with
EXPORT_GPL_SIMPLE_DEV_PM_OPS().

Removed PM preprocessor conditions with usage of pm_sleep_ptr().

Signed-off-by: Michael Harris <michaelharriscode@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Michael Harris and committed by
Jonathan Cameron
c84cde33 a7500888

+5 -11
+1 -1
drivers/staging/iio/addac/adt7316-i2c.c
··· 136 136 .driver = { 137 137 .name = "adt7316", 138 138 .of_match_table = adt7316_of_match, 139 - .pm = ADT7316_PM_OPS, 139 + .pm = pm_sleep_ptr(&adt7316_pm_ops), 140 140 }, 141 141 .probe = adt7316_i2c_probe, 142 142 .id_table = adt7316_i2c_id,
+1 -1
drivers/staging/iio/addac/adt7316-spi.c
··· 142 142 .driver = { 143 143 .name = "adt7316", 144 144 .of_match_table = adt7316_of_spi_match, 145 - .pm = ADT7316_PM_OPS, 145 + .pm = pm_sleep_ptr(&adt7316_pm_ops), 146 146 }, 147 147 .probe = adt7316_spi_probe, 148 148 .id_table = adt7316_spi_id,
+2 -4
drivers/staging/iio/addac/adt7316.c
··· 2082 2082 .name = "events", 2083 2083 }; 2084 2084 2085 - #ifdef CONFIG_PM_SLEEP 2086 2085 static int adt7316_disable(struct device *dev) 2087 2086 { 2088 2087 struct iio_dev *dev_info = dev_get_drvdata(dev); ··· 2097 2098 2098 2099 return _adt7316_store_enabled(chip, 1); 2099 2100 } 2100 - EXPORT_SYMBOL_GPL(adt7316_pm_ops); 2101 - SIMPLE_DEV_PM_OPS(adt7316_pm_ops, adt7316_disable, adt7316_enable); 2102 - #endif 2101 + 2102 + EXPORT_GPL_SIMPLE_DEV_PM_OPS(adt7316_pm_ops, adt7316_disable, adt7316_enable); 2103 2103 2104 2104 static const struct iio_info adt7316_info = { 2105 2105 .attrs = &adt7316_attribute_group,
+1 -5
drivers/staging/iio/addac/adt7316.h
··· 22 22 int (*multi_write)(void *client, u8 first_reg, u8 count, u8 *data); 23 23 }; 24 24 25 - #ifdef CONFIG_PM_SLEEP 26 25 extern const struct dev_pm_ops adt7316_pm_ops; 27 - #define ADT7316_PM_OPS (&adt7316_pm_ops) 28 - #else 29 - #define ADT7316_PM_OPS NULL 30 - #endif 26 + 31 27 int adt7316_probe(struct device *dev, struct adt7316_bus *bus, 32 28 const char *name); 33 29