aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-04-11 05:24:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-11 15:39:02 -0400
commit873bf4f46c7ab9b97da7458029e5e7b645578dfe (patch)
treee1bd931b03f6062c0e57fa689920c746885c5dc0 /drivers
parent5d4717d76f06d56586addcda59572113167e07da (diff)
misc: isl29003: 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: Daniel Mack <daniel@caiaq.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/isl29003.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c
index 29b306c6bdb3..c5145b3fcce8 100644
--- a/drivers/misc/isl29003.c
+++ b/drivers/misc/isl29003.c
@@ -409,18 +409,20 @@ static int isl29003_remove(struct i2c_client *client)
409 return 0; 409 return 0;
410} 410}
411 411
412#ifdef CONFIG_PM 412#ifdef CONFIG_PM_SLEEP
413static int isl29003_suspend(struct i2c_client *client, pm_message_t mesg) 413static int isl29003_suspend(struct device *dev)
414{ 414{
415 struct i2c_client *client = to_i2c_client(dev);
415 struct isl29003_data *data = i2c_get_clientdata(client); 416 struct isl29003_data *data = i2c_get_clientdata(client);
416 417
417 data->power_state_before_suspend = isl29003_get_power_state(client); 418 data->power_state_before_suspend = isl29003_get_power_state(client);
418 return isl29003_set_power_state(client, 0); 419 return isl29003_set_power_state(client, 0);
419} 420}
420 421
421static int isl29003_resume(struct i2c_client *client) 422static int isl29003_resume(struct device *dev)
422{ 423{
423 int i; 424 int i;
425 struct i2c_client *client = to_i2c_client(dev);
424 struct isl29003_data *data = i2c_get_clientdata(client); 426 struct isl29003_data *data = i2c_get_clientdata(client);
425 427
426 /* restore registers from cache */ 428 /* restore registers from cache */
@@ -432,10 +434,12 @@ static int isl29003_resume(struct i2c_client *client)
432 data->power_state_before_suspend); 434 data->power_state_before_suspend);
433} 435}
434 436
437static SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume);
438#define ISL29003_PM_OPS (&isl29003_pm_ops)
439
435#else 440#else
436#define isl29003_suspend NULL 441#define ISL29003_PM_OPS NULL
437#define isl29003_resume NULL 442#endif /* CONFIG_PM_SLEEP */
438#endif /* CONFIG_PM */
439 443
440static const struct i2c_device_id isl29003_id[] = { 444static const struct i2c_device_id isl29003_id[] = {
441 { "isl29003", 0 }, 445 { "isl29003", 0 },
@@ -447,9 +451,8 @@ static struct i2c_driver isl29003_driver = {
447 .driver = { 451 .driver = {
448 .name = ISL29003_DRV_NAME, 452 .name = ISL29003_DRV_NAME,
449 .owner = THIS_MODULE, 453 .owner = THIS_MODULE,
454 .pm = ISL29003_PM_OPS,
450 }, 455 },
451 .suspend = isl29003_suspend,
452 .resume = isl29003_resume,
453 .probe = isl29003_probe, 456 .probe = isl29003_probe,
454 .remove = isl29003_remove, 457 .remove = isl29003_remove,
455 .id_table = isl29003_id, 458 .id_table = isl29003_id,