mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
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>
This commit is contained in:
parent
75311bea56
commit
4f0928c665
1 changed files with 10 additions and 9 deletions
|
@ -1513,10 +1513,10 @@ static struct abituguru_data *abituguru_update_device(struct device *dev)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int abituguru_suspend(struct platform_device *pdev, pm_message_t state)
|
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
|
* make sure all communications with the uguru are done and no new
|
||||||
* ones are started
|
* ones are started
|
||||||
|
@ -1525,29 +1525,30 @@ static int abituguru_suspend(struct platform_device *pdev, pm_message_t state)
|
||||||
return 0;
|
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 */
|
/* See if the uGuru is still ready */
|
||||||
if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT)
|
if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT)
|
||||||
data->uguru_ready = 0;
|
data->uguru_ready = 0;
|
||||||
mutex_unlock(&data->update_lock);
|
mutex_unlock(&data->update_lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume);
|
||||||
|
#define ABIT_UGURU_PM &abituguru_pm
|
||||||
#else
|
#else
|
||||||
#define abituguru_suspend NULL
|
#define ABIT_UGURU_PM NULL
|
||||||
#define abituguru_resume NULL
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
static struct platform_driver abituguru_driver = {
|
static struct platform_driver abituguru_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = ABIT_UGURU_NAME,
|
.name = ABIT_UGURU_NAME,
|
||||||
|
.pm = ABIT_UGURU_PM,
|
||||||
},
|
},
|
||||||
.probe = abituguru_probe,
|
.probe = abituguru_probe,
|
||||||
.remove = __devexit_p(abituguru_remove),
|
.remove = __devexit_p(abituguru_remove),
|
||||||
.suspend = abituguru_suspend,
|
|
||||||
.resume = abituguru_resume,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init abituguru_detect(void)
|
static int __init abituguru_detect(void)
|
||||||
|
|
Loading…
Reference in a new issue