hwmon: (abituguru3) Use struct dev_pm_ops for power management
Make the Abit uGuru rev. 3 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
4f0928c665
commit
c248f24cff
@ -1141,10 +1141,10 @@ LEAVE_UPDATE:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int abituguru3_suspend(struct platform_device *pdev, pm_message_t state)
|
static int abituguru3_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct abituguru3_data *data = platform_get_drvdata(pdev);
|
struct abituguru3_data *data = dev_get_drvdata(dev);
|
||||||
/*
|
/*
|
||||||
* make sure all communications with the uguru3 are done and no new
|
* make sure all communications with the uguru3 are done and no new
|
||||||
* ones are started
|
* ones are started
|
||||||
@ -1153,26 +1153,27 @@ static int abituguru3_suspend(struct platform_device *pdev, pm_message_t state)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int abituguru3_resume(struct platform_device *pdev)
|
static int abituguru3_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct abituguru3_data *data = platform_get_drvdata(pdev);
|
struct abituguru3_data *data = dev_get_drvdata(dev);
|
||||||
mutex_unlock(&data->update_lock);
|
mutex_unlock(&data->update_lock);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static SIMPLE_DEV_PM_OPS(abituguru3_pm, abituguru3_suspend, abituguru3_resume);
|
||||||
|
#define ABIT_UGURU3_PM &abituguru3_pm
|
||||||
#else
|
#else
|
||||||
#define abituguru3_suspend NULL
|
#define ABIT_UGURU3_PM NULL
|
||||||
#define abituguru3_resume NULL
|
|
||||||
#endif /* CONFIG_PM */
|
#endif /* CONFIG_PM */
|
||||||
|
|
||||||
static struct platform_driver abituguru3_driver = {
|
static struct platform_driver abituguru3_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.name = ABIT_UGURU3_NAME,
|
.name = ABIT_UGURU3_NAME,
|
||||||
|
.pm = ABIT_UGURU3_PM
|
||||||
},
|
},
|
||||||
.probe = abituguru3_probe,
|
.probe = abituguru3_probe,
|
||||||
.remove = __devexit_p(abituguru3_remove),
|
.remove = __devexit_p(abituguru3_remove),
|
||||||
.suspend = abituguru3_suspend,
|
|
||||||
.resume = abituguru3_resume
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init abituguru3_dmi_detect(void)
|
static int __init abituguru3_dmi_detect(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user