aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/tsl2550.c21
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
422static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg) 422static 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
427static int tsl2550_resume(struct i2c_client *client) 427static 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
432static 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
439static const struct i2c_device_id tsl2550_id[] = { 441static 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,