]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: iio: adt7316: modernize power management
authorMichael Harris <michaelharriscode@gmail.com>
Tue, 6 Jan 2026 14:50:55 +0000 (06:50 -0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 11 Jan 2026 13:00:22 +0000 (13:00 +0000)
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>
drivers/staging/iio/addac/adt7316-i2c.c
drivers/staging/iio/addac/adt7316-spi.c
drivers/staging/iio/addac/adt7316.c
drivers/staging/iio/addac/adt7316.h

index f45968ef94eaa59382a8cc70721f3cd56834b4e5..3bdaee925deeeb4fe5b573ab9b9bbbbc892e2bd4 100644 (file)
@@ -136,7 +136,7 @@ static struct i2c_driver adt7316_driver = {
        .driver = {
                .name = "adt7316",
                .of_match_table = adt7316_of_match,
-               .pm = ADT7316_PM_OPS,
+               .pm = pm_sleep_ptr(&adt7316_pm_ops),
        },
        .probe = adt7316_i2c_probe,
        .id_table = adt7316_i2c_id,
index af513e003da705581b1e348ecf557c927cfc73f7..f91325d11394da3179ec73e1643f280018d754ff 100644 (file)
@@ -142,7 +142,7 @@ static struct spi_driver adt7316_driver = {
        .driver = {
                .name = "adt7316",
                .of_match_table = adt7316_of_spi_match,
-               .pm = ADT7316_PM_OPS,
+               .pm = pm_sleep_ptr(&adt7316_pm_ops),
        },
        .probe = adt7316_spi_probe,
        .id_table = adt7316_spi_id,
index 8a9a8262c2bec34f3c3e79d8174f492b9a23fb70..59fb3bd26bc1f851eb207d8f468dd61b71012e84 100644 (file)
@@ -2082,7 +2082,6 @@ static const struct attribute_group adt7516_event_attribute_group = {
        .name = "events",
 };
 
-#ifdef CONFIG_PM_SLEEP
 static int adt7316_disable(struct device *dev)
 {
        struct iio_dev *dev_info = dev_get_drvdata(dev);
@@ -2098,9 +2097,8 @@ static int adt7316_enable(struct device *dev)
 
        return _adt7316_store_enabled(chip, 1);
 }
-EXPORT_SYMBOL_GPL(adt7316_pm_ops);
-SIMPLE_DEV_PM_OPS(adt7316_pm_ops, adt7316_disable, adt7316_enable);
-#endif
+
+EXPORT_GPL_SIMPLE_DEV_PM_OPS(adt7316_pm_ops, adt7316_disable, adt7316_enable);
 
 static const struct iio_info adt7316_info = {
        .attrs = &adt7316_attribute_group,
index 8c2a92ae7157069ea1a50ab0451f7703d1323a44..f208f0d3583a3ff6512fafc9dc3240866f5b26da 100644 (file)
@@ -22,12 +22,8 @@ struct adt7316_bus {
        int (*multi_write)(void *client, u8 first_reg, u8 count, u8 *data);
 };
 
-#ifdef CONFIG_PM_SLEEP
 extern const struct dev_pm_ops adt7316_pm_ops;
-#define ADT7316_PM_OPS (&adt7316_pm_ops)
-#else
-#define ADT7316_PM_OPS NULL
-#endif
+
 int adt7316_probe(struct device *dev, struct adt7316_bus *bus,
                  const char *name);