diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-01-20 16:45:46 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-23 05:41:43 -0400 |
commit | dc781454690d7e5857afd84845b6402e03493ee1 (patch) | |
tree | 9dc97835dcf523b6f92ca2a2dc2d534a8ac501dd /drivers/mfd/adp5520.c | |
parent | df508450870cd5b4478156dcde8e68e6bf0d6661 (diff) |
mfd: Convert adp5520 to dev_pm_ops
There is a move to deprecate bus-specific PM operations and move to
using dev_pm_ops instead in order to reduce the amount of boilerplate
code in buses and facilitiate updates to the PM core. Do this move for
the adp5520 driver.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/adp5520.c')
-rw-r--r-- | drivers/mfd/adp5520.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c index 3122139b4300..f1d88483112c 100644 --- a/drivers/mfd/adp5520.c +++ b/drivers/mfd/adp5520.c | |||
@@ -321,27 +321,27 @@ static int __devexit adp5520_remove(struct i2c_client *client) | |||
321 | } | 321 | } |
322 | 322 | ||
323 | #ifdef CONFIG_PM | 323 | #ifdef CONFIG_PM |
324 | static int adp5520_suspend(struct i2c_client *client, | 324 | static int adp5520_suspend(struct device *dev) |
325 | pm_message_t state) | ||
326 | { | 325 | { |
326 | struct i2c_client *client = to_i2c_client(dev); | ||
327 | struct adp5520_chip *chip = dev_get_drvdata(&client->dev); | 327 | struct adp5520_chip *chip = dev_get_drvdata(&client->dev); |
328 | 328 | ||
329 | adp5520_clr_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY); | 329 | adp5520_clr_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY); |
330 | return 0; | 330 | return 0; |
331 | } | 331 | } |
332 | 332 | ||
333 | static int adp5520_resume(struct i2c_client *client) | 333 | static int adp5520_resume(struct device *dev) |
334 | { | 334 | { |
335 | struct i2c_client *client = to_i2c_client(dev); | ||
335 | struct adp5520_chip *chip = dev_get_drvdata(&client->dev); | 336 | struct adp5520_chip *chip = dev_get_drvdata(&client->dev); |
336 | 337 | ||
337 | adp5520_set_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY); | 338 | adp5520_set_bits(chip->dev, ADP5520_MODE_STATUS, ADP5520_nSTNBY); |
338 | return 0; | 339 | return 0; |
339 | } | 340 | } |
340 | #else | ||
341 | #define adp5520_suspend NULL | ||
342 | #define adp5520_resume NULL | ||
343 | #endif | 341 | #endif |
344 | 342 | ||
343 | static SIMPLE_DEV_PM_OPS(adp5520_pm, adp5520_suspend, adp5520_resume); | ||
344 | |||
345 | static const struct i2c_device_id adp5520_id[] = { | 345 | static const struct i2c_device_id adp5520_id[] = { |
346 | { "pmic-adp5520", ID_ADP5520 }, | 346 | { "pmic-adp5520", ID_ADP5520 }, |
347 | { "pmic-adp5501", ID_ADP5501 }, | 347 | { "pmic-adp5501", ID_ADP5501 }, |
@@ -353,11 +353,10 @@ static struct i2c_driver adp5520_driver = { | |||
353 | .driver = { | 353 | .driver = { |
354 | .name = "adp5520", | 354 | .name = "adp5520", |
355 | .owner = THIS_MODULE, | 355 | .owner = THIS_MODULE, |
356 | .pm = &adp5520_pm, | ||
356 | }, | 357 | }, |
357 | .probe = adp5520_probe, | 358 | .probe = adp5520_probe, |
358 | .remove = __devexit_p(adp5520_remove), | 359 | .remove = __devexit_p(adp5520_remove), |
359 | .suspend = adp5520_suspend, | ||
360 | .resume = adp5520_resume, | ||
361 | .id_table = adp5520_id, | 360 | .id_table = adp5520_id, |
362 | }; | 361 | }; |
363 | 362 | ||