diff options
Diffstat (limited to 'drivers/iio/magnetometer')
-rw-r--r-- | drivers/iio/magnetometer/ak8974.c | 14 | ||||
-rw-r--r-- | drivers/iio/magnetometer/bmc150_magn.c | 3 | ||||
-rw-r--r-- | drivers/iio/magnetometer/bmc150_magn.h | 2 | ||||
-rw-r--r-- | drivers/iio/magnetometer/bmc150_magn_i2c.c | 4 | ||||
-rw-r--r-- | drivers/iio/magnetometer/hmc5843_core.c | 2 | ||||
-rw-r--r-- | drivers/iio/magnetometer/rm3100-core.c | 2 | ||||
-rw-r--r-- | drivers/iio/magnetometer/yamaha-yas530.c | 14 |
7 files changed, 17 insertions, 24 deletions
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index e54feacfb980..c89a91db0690 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c @@ -985,7 +985,7 @@ static int ak8974_remove(struct i2c_client *i2c) return 0; } -static int __maybe_unused ak8974_runtime_suspend(struct device *dev) +static int ak8974_runtime_suspend(struct device *dev) { struct ak8974 *ak8974 = iio_priv(i2c_get_clientdata(to_i2c_client(dev))); @@ -996,7 +996,7 @@ static int __maybe_unused ak8974_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused ak8974_runtime_resume(struct device *dev) +static int ak8974_runtime_resume(struct device *dev) { struct ak8974 *ak8974 = iio_priv(i2c_get_clientdata(to_i2c_client(dev))); @@ -1024,12 +1024,8 @@ out_regulator_disable: return ret; } -static const struct dev_pm_ops ak8974_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(ak8974_runtime_suspend, - ak8974_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(ak8974_dev_pm_ops, ak8974_runtime_suspend, + ak8974_runtime_resume, NULL); static const struct i2c_device_id ak8974_id[] = { {"ami305", 0 }, @@ -1050,7 +1046,7 @@ MODULE_DEVICE_TABLE(of, ak8974_of_match); static struct i2c_driver ak8974_driver = { .driver = { .name = "ak8974", - .pm = &ak8974_dev_pm_ops, + .pm = pm_ptr(&ak8974_dev_pm_ops), .of_match_table = ak8974_of_match, }, .probe = ak8974_probe, diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c index 64e8b04e654b..06d5a1ef1fbd 100644 --- a/drivers/iio/magnetometer/bmc150_magn.c +++ b/drivers/iio/magnetometer/bmc150_magn.c @@ -985,7 +985,7 @@ err_poweroff: } EXPORT_SYMBOL_NS(bmc150_magn_probe, IIO_BMC150_MAGN); -int bmc150_magn_remove(struct device *dev) +void bmc150_magn_remove(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct bmc150_magn_data *data = iio_priv(indio_dev); @@ -1008,7 +1008,6 @@ int bmc150_magn_remove(struct device *dev) mutex_unlock(&data->mutex); regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators); - return 0; } EXPORT_SYMBOL_NS(bmc150_magn_remove, IIO_BMC150_MAGN); diff --git a/drivers/iio/magnetometer/bmc150_magn.h b/drivers/iio/magnetometer/bmc150_magn.h index 3b69232afd2c..98c086d10c13 100644 --- a/drivers/iio/magnetometer/bmc150_magn.h +++ b/drivers/iio/magnetometer/bmc150_magn.h @@ -7,6 +7,6 @@ extern const struct dev_pm_ops bmc150_magn_pm_ops; int bmc150_magn_probe(struct device *dev, struct regmap *regmap, int irq, const char *name); -int bmc150_magn_remove(struct device *dev); +void bmc150_magn_remove(struct device *dev); #endif /* _BMC150_MAGN_H_ */ diff --git a/drivers/iio/magnetometer/bmc150_magn_i2c.c b/drivers/iio/magnetometer/bmc150_magn_i2c.c index e39b89661ad1..65c004411d0f 100644 --- a/drivers/iio/magnetometer/bmc150_magn_i2c.c +++ b/drivers/iio/magnetometer/bmc150_magn_i2c.c @@ -36,7 +36,9 @@ static int bmc150_magn_i2c_probe(struct i2c_client *client, static int bmc150_magn_i2c_remove(struct i2c_client *client) { - return bmc150_magn_remove(&client->dev); + bmc150_magn_remove(&client->dev); + + return 0; } static const struct acpi_device_id bmc150_magn_acpi_match[] = { diff --git a/drivers/iio/magnetometer/hmc5843_core.c b/drivers/iio/magnetometer/hmc5843_core.c index 92eb2d156ddb..4a63b2da9df0 100644 --- a/drivers/iio/magnetometer/hmc5843_core.c +++ b/drivers/iio/magnetometer/hmc5843_core.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Device driver for the the HMC5843 multi-chip module designed + * Device driver for the HMC5843 multi-chip module designed * for low field magnetic sensing. * * Copyright (C) 2010 Texas Instruments diff --git a/drivers/iio/magnetometer/rm3100-core.c b/drivers/iio/magnetometer/rm3100-core.c index 707ba25360b8..69938204456f 100644 --- a/drivers/iio/magnetometer/rm3100-core.c +++ b/drivers/iio/magnetometer/rm3100-core.c @@ -544,7 +544,7 @@ int rm3100_common_probe(struct device *dev, struct regmap *regmap, int irq) indio_dev->info = &rm3100_info; indio_dev->channels = rm3100_channels; indio_dev->num_channels = ARRAY_SIZE(rm3100_channels); - indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_TRIGGERED; + indio_dev->modes = INDIO_DIRECT_MODE; if (!irq) data->use_interrupt = false; diff --git a/drivers/iio/magnetometer/yamaha-yas530.c b/drivers/iio/magnetometer/yamaha-yas530.c index b2bc637150bf..aeaa4da6923b 100644 --- a/drivers/iio/magnetometer/yamaha-yas530.c +++ b/drivers/iio/magnetometer/yamaha-yas530.c @@ -965,7 +965,7 @@ static int yas5xx_remove(struct i2c_client *i2c) return 0; } -static int __maybe_unused yas5xx_runtime_suspend(struct device *dev) +static int yas5xx_runtime_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct yas5xx *yas5xx = iio_priv(indio_dev); @@ -976,7 +976,7 @@ static int __maybe_unused yas5xx_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused yas5xx_runtime_resume(struct device *dev) +static int yas5xx_runtime_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct yas5xx *yas5xx = iio_priv(indio_dev); @@ -1011,12 +1011,8 @@ out_reset: return ret; } -static const struct dev_pm_ops yas5xx_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(yas5xx_runtime_suspend, - yas5xx_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(yas5xx_dev_pm_ops, yas5xx_runtime_suspend, + yas5xx_runtime_resume, NULL); static const struct i2c_device_id yas5xx_id[] = { {"yas530", }, @@ -1038,7 +1034,7 @@ static struct i2c_driver yas5xx_driver = { .driver = { .name = "yas5xx", .of_match_table = yas5xx_of_match, - .pm = &yas5xx_dev_pm_ops, + .pm = pm_ptr(&yas5xx_dev_pm_ops), }, .probe = yas5xx_probe, .remove = yas5xx_remove, |