diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 16:18:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:28:18 -0700 |
commit | 1dde37d4574cce3c0c99ddffc3623b533578be49 (patch) | |
tree | 5dd8309f161d166e3dc375201d5a8a784580b35c /drivers/video/backlight/tosa_bl.c | |
parent | 07cac9d78fcc9a0a3dd7c5b8523371f4d8cae591 (diff) |
backlight: tosa: convert tosa to dev_pm_ops
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight/tosa_bl.c')
-rw-r--r-- | drivers/video/backlight/tosa_bl.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 2326fa810c59..9df66ac68b34 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c @@ -134,28 +134,27 @@ static int tosa_bl_remove(struct i2c_client *client) return 0; } -#ifdef CONFIG_PM -static int tosa_bl_suspend(struct i2c_client *client, pm_message_t pm) +#ifdef CONFIG_PM_SLEEP +static int tosa_bl_suspend(struct device *dev) { - struct tosa_bl_data *data = i2c_get_clientdata(client); + struct tosa_bl_data *data = dev_get_drvdata(dev); tosa_bl_set_backlight(data, 0); return 0; } -static int tosa_bl_resume(struct i2c_client *client) +static int tosa_bl_resume(struct device *dev) { - struct tosa_bl_data *data = i2c_get_clientdata(client); + struct tosa_bl_data *data = dev_get_drvdata(dev); backlight_update_status(data->bl); return 0; } -#else -#define tosa_bl_suspend NULL -#define tosa_bl_resume NULL #endif +static SIMPLE_DEV_PM_OPS(tosa_bl_pm_ops, tosa_bl_suspend, tosa_bl_resume); + static const struct i2c_device_id tosa_bl_id[] = { { "tosa-bl", 0 }, { }, @@ -165,11 +164,10 @@ static struct i2c_driver tosa_bl_driver = { .driver = { .name = "tosa-bl", .owner = THIS_MODULE, + .pm = &tosa_bl_pm_ops, }, .probe = tosa_bl_probe, .remove = tosa_bl_remove, - .suspend = tosa_bl_suspend, - .resume = tosa_bl_resume, .id_table = tosa_bl_id, }; |