Commit a7761027 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Greg Kroah-Hartman

misc: tsl2550: Use dev_pm_ops

Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 873bf4f4
...@@ -417,24 +417,26 @@ static int tsl2550_remove(struct i2c_client *client) ...@@ -417,24 +417,26 @@ static int tsl2550_remove(struct i2c_client *client)
return 0; return 0;
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM_SLEEP
static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg) static int tsl2550_suspend(struct device *dev)
{ {
return tsl2550_set_power_state(client, 0); return tsl2550_set_power_state(to_i2c_client(dev), 0);
} }
static int tsl2550_resume(struct i2c_client *client) static int tsl2550_resume(struct device *dev)
{ {
return tsl2550_set_power_state(client, 1); return tsl2550_set_power_state(to_i2c_client(dev), 1);
} }
static SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume);
#define TSL2550_PM_OPS (&tsl2550_pm_ops)
#else #else
#define tsl2550_suspend NULL #define TSL2550_PM_OPS NULL
#define tsl2550_resume NULL
#endif /* CONFIG_PM */ #endif /* CONFIG_PM_SLEEP */
static const struct i2c_device_id tsl2550_id[] = { static const struct i2c_device_id tsl2550_id[] = {
{ "tsl2550", 0 }, { "tsl2550", 0 },
...@@ -446,9 +448,8 @@ static struct i2c_driver tsl2550_driver = { ...@@ -446,9 +448,8 @@ static struct i2c_driver tsl2550_driver = {
.driver = { .driver = {
.name = TSL2550_DRV_NAME, .name = TSL2550_DRV_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
.pm = TSL2550_PM_OPS,
}, },
.suspend = tsl2550_suspend,
.resume = tsl2550_resume,
.probe = tsl2550_probe, .probe = tsl2550_probe,
.remove = tsl2550_remove, .remove = tsl2550_remove,
.id_table = tsl2550_id, .id_table = tsl2550_id,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment