diff options
Diffstat (limited to 'drivers/iio/light/isl29028.c')
-rw-r--r-- | drivers/iio/light/isl29028.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/iio/light/isl29028.c b/drivers/iio/light/isl29028.c index 9de3262aa688..ff5996d77818 100644 --- a/drivers/iio/light/isl29028.c +++ b/drivers/iio/light/isl29028.c @@ -625,7 +625,7 @@ static int isl29028_probe(struct i2c_client *client, ISL29028_POWER_OFF_DELAY_MS); pm_runtime_use_autosuspend(&client->dev); - ret = devm_iio_device_register(indio_dev->dev.parent, indio_dev); + ret = iio_device_register(indio_dev); if (ret < 0) { dev_err(&client->dev, "%s(): iio registration failed with error %d\n", @@ -646,10 +646,12 @@ static int isl29028_remove(struct i2c_client *client) pm_runtime_disable(&client->dev); pm_runtime_set_suspended(&client->dev); - return isl29028_clear_configure_reg(chip); + isl29028_clear_configure_reg(chip); + + return 0; } -static int __maybe_unused isl29028_suspend(struct device *dev) +static int isl29028_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct isl29028_chip *chip = iio_priv(indio_dev); @@ -664,7 +666,7 @@ static int __maybe_unused isl29028_suspend(struct device *dev) return ret; } -static int __maybe_unused isl29028_resume(struct device *dev) +static int isl29028_resume(struct device *dev) { /** * The specific component (ALS/IR or proximity) will enable itself as @@ -674,11 +676,8 @@ static int __maybe_unused isl29028_resume(struct device *dev) return 0; } -static const struct dev_pm_ops isl29028_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(isl29028_suspend, isl29028_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(isl29028_pm_ops, isl29028_suspend, + isl29028_resume, NULL); static const struct i2c_device_id isl29028_id[] = { {"isl29028", 0}, @@ -698,7 +697,7 @@ MODULE_DEVICE_TABLE(of, isl29028_of_match); static struct i2c_driver isl29028_driver = { .driver = { .name = "isl29028", - .pm = &isl29028_pm_ops, + .pm = pm_ptr(&isl29028_pm_ops), .of_match_table = isl29028_of_match, }, .probe = isl29028_probe, |