diff options
-rw-r--r-- | drivers/misc/isl29003.c | 19 |
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 |
413 | static int isl29003_suspend(struct i2c_client *client, pm_message_t mesg) | 413 | static 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 | ||
421 | static int isl29003_resume(struct i2c_client *client) | 422 | static 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 | ||
437 | static 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 | ||
440 | static const struct i2c_device_id isl29003_id[] = { | 444 | static 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, |