diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-07 23:59:12 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-07-21 21:48:44 -0700 |
commit | 4f0928c6652d8b512f81002ebf66ef0b22cf1af4 (patch) | |
tree | 0b1f8c8ba791cac2c912ad2eab335a3b2e6483bf /drivers/hwmon | |
parent | 75311bea569d7ea77a5a3c5395bae27bb8a2df96 (diff) | |
download | op-kernel-dev-4f0928c6652d8b512f81002ebf66ef0b22cf1af4.zip op-kernel-dev-4f0928c6652d8b512f81002ebf66ef0b22cf1af4.tar.gz |
hwmon: (abituguru) Use struct dev_pm_ops for power management
Make the Abit uGuru driver define its PM callbacks through
a struct dev_pm_ops object rather than by using legacy PM hooks
in struct platform_driver.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
[linux@roeck-us.net: CONFIG_PM->CONFIG_PM_SLEEP, and remove unnecessary ()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/abituguru.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c index a72bf25..d4419b4 100644 --- a/drivers/hwmon/abituguru.c +++ b/drivers/hwmon/abituguru.c @@ -1513,10 +1513,10 @@ LEAVE_UPDATE: return NULL; } -#ifdef CONFIG_PM -static int abituguru_suspend(struct platform_device *pdev, pm_message_t state) +#ifdef CONFIG_PM_SLEEP +static int abituguru_suspend(struct device *dev) { - struct abituguru_data *data = platform_get_drvdata(pdev); + struct abituguru_data *data = dev_get_drvdata(dev); /* * make sure all communications with the uguru are done and no new * ones are started @@ -1525,29 +1525,30 @@ static int abituguru_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -static int abituguru_resume(struct platform_device *pdev) +static int abituguru_resume(struct device *dev) { - struct abituguru_data *data = platform_get_drvdata(pdev); + struct abituguru_data *data = dev_get_drvdata(dev); /* See if the uGuru is still ready */ if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT) data->uguru_ready = 0; mutex_unlock(&data->update_lock); return 0; } + +static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume); +#define ABIT_UGURU_PM &abituguru_pm #else -#define abituguru_suspend NULL -#define abituguru_resume NULL +#define ABIT_UGURU_PM NULL #endif /* CONFIG_PM */ static struct platform_driver abituguru_driver = { .driver = { .owner = THIS_MODULE, .name = ABIT_UGURU_NAME, + .pm = ABIT_UGURU_PM, }, .probe = abituguru_probe, .remove = __devexit_p(abituguru_remove), - .suspend = abituguru_suspend, - .resume = abituguru_resume, }; static int __init abituguru_detect(void) |