diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-04-11 05:24:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-11 15:39:02 -0400 |
commit | a7761027656dc192b59617a6eb961e38097419ce (patch) | |
tree | c518537bc50e7d45f43d90903014d5fa0aabe078 /drivers/misc | |
parent | 873bf4f46c7ab9b97da7458029e5e7b645578dfe (diff) |
misc: tsl2550: Use dev_pm_ops
Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Rodolfo Giometti <giometti@enneenne.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/tsl2550.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c index 1e7bc0eb081e..1dfde4d543db 100644 --- a/drivers/misc/tsl2550.c +++ b/drivers/misc/tsl2550.c | |||
@@ -417,24 +417,26 @@ static int tsl2550_remove(struct i2c_client *client) | |||
417 | return 0; | 417 | return 0; |
418 | } | 418 | } |
419 | 419 | ||
420 | #ifdef CONFIG_PM | 420 | #ifdef CONFIG_PM_SLEEP |
421 | 421 | ||
422 | static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg) | 422 | static int tsl2550_suspend(struct device *dev) |
423 | { | 423 | { |
424 | return tsl2550_set_power_state(client, 0); | 424 | return tsl2550_set_power_state(to_i2c_client(dev), 0); |
425 | } | 425 | } |
426 | 426 | ||
427 | static int tsl2550_resume(struct i2c_client *client) | 427 | static int tsl2550_resume(struct device *dev) |
428 | { | 428 | { |
429 | return tsl2550_set_power_state(client, 1); | 429 | return tsl2550_set_power_state(to_i2c_client(dev), 1); |
430 | } | 430 | } |
431 | 431 | ||
432 | static SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume); | ||
433 | #define TSL2550_PM_OPS (&tsl2550_pm_ops) | ||
434 | |||
432 | #else | 435 | #else |
433 | 436 | ||
434 | #define tsl2550_suspend NULL | 437 | #define TSL2550_PM_OPS NULL |
435 | #define tsl2550_resume NULL | ||
436 | 438 | ||
437 | #endif /* CONFIG_PM */ | 439 | #endif /* CONFIG_PM_SLEEP */ |
438 | 440 | ||
439 | static const struct i2c_device_id tsl2550_id[] = { | 441 | static const struct i2c_device_id tsl2550_id[] = { |
440 | { "tsl2550", 0 }, | 442 | { "tsl2550", 0 }, |
@@ -446,9 +448,8 @@ static struct i2c_driver tsl2550_driver = { | |||
446 | .driver = { | 448 | .driver = { |
447 | .name = TSL2550_DRV_NAME, | 449 | .name = TSL2550_DRV_NAME, |
448 | .owner = THIS_MODULE, | 450 | .owner = THIS_MODULE, |
451 | .pm = TSL2550_PM_OPS, | ||
449 | }, | 452 | }, |
450 | .suspend = tsl2550_suspend, | ||
451 | .resume = tsl2550_resume, | ||
452 | .probe = tsl2550_probe, | 453 | .probe = tsl2550_probe, |
453 | .remove = tsl2550_remove, | 454 | .remove = tsl2550_remove, |
454 | .id_table = tsl2550_id, | 455 | .id_table = tsl2550_id, |