diff options
Diffstat (limited to 'drivers/iio/light/tsl2583.c')
-rw-r--r-- | drivers/iio/light/tsl2583.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/iio/light/tsl2583.c b/drivers/iio/light/tsl2583.c index 7e101d5f72ee..82662dab87c0 100644 --- a/drivers/iio/light/tsl2583.c +++ b/drivers/iio/light/tsl2583.c @@ -883,10 +883,12 @@ static int tsl2583_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - return tsl2583_set_power_state(chip, TSL2583_CNTL_PWR_OFF); + tsl2583_set_power_state(chip, TSL2583_CNTL_PWR_OFF); + + return 0; } -static int __maybe_unused tsl2583_suspend(struct device *dev) +static int tsl2583_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct tsl2583_chip *chip = iio_priv(indio_dev); @@ -901,7 +903,7 @@ static int __maybe_unused tsl2583_suspend(struct device *dev) return ret; } -static int __maybe_unused tsl2583_resume(struct device *dev) +static int tsl2583_resume(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct tsl2583_chip *chip = iio_priv(indio_dev); @@ -916,11 +918,8 @@ static int __maybe_unused tsl2583_resume(struct device *dev) return ret; } -static const struct dev_pm_ops tsl2583_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(tsl2583_suspend, tsl2583_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(tsl2583_pm_ops, tsl2583_suspend, + tsl2583_resume, NULL); static const struct i2c_device_id tsl2583_idtable[] = { { "tsl2580", 0 }, @@ -942,7 +941,7 @@ MODULE_DEVICE_TABLE(of, tsl2583_of_match); static struct i2c_driver tsl2583_driver = { .driver = { .name = "tsl2583", - .pm = &tsl2583_pm_ops, + .pm = pm_ptr(&tsl2583_pm_ops), .of_match_table = tsl2583_of_match, }, .id_table = tsl2583_idtable, |