aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/abituguru.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index a72bf25601a4..d4419b47f3d4 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1513,10 +1513,10 @@ LEAVE_UPDATE:
1513 return NULL; 1513 return NULL;
1514} 1514}
1515 1515
1516#ifdef CONFIG_PM 1516#ifdef CONFIG_PM_SLEEP
1517static int abituguru_suspend(struct platform_device *pdev, pm_message_t state) 1517static int abituguru_suspend(struct device *dev)
1518{ 1518{
1519 struct abituguru_data *data = platform_get_drvdata(pdev); 1519 struct abituguru_data *data = dev_get_drvdata(dev);
1520 /* 1520 /*
1521 * make sure all communications with the uguru are done and no new 1521 * make sure all communications with the uguru are done and no new
1522 * ones are started 1522 * ones are started
@@ -1525,29 +1525,30 @@ static int abituguru_suspend(struct platform_device *pdev, pm_message_t state)
1525 return 0; 1525 return 0;
1526} 1526}
1527 1527
1528static int abituguru_resume(struct platform_device *pdev) 1528static int abituguru_resume(struct device *dev)
1529{ 1529{
1530 struct abituguru_data *data = platform_get_drvdata(pdev); 1530 struct abituguru_data *data = dev_get_drvdata(dev);
1531 /* See if the uGuru is still ready */ 1531 /* See if the uGuru is still ready */
1532 if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT) 1532 if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT)
1533 data->uguru_ready = 0; 1533 data->uguru_ready = 0;
1534 mutex_unlock(&data->update_lock); 1534 mutex_unlock(&data->update_lock);
1535 return 0; 1535 return 0;
1536} 1536}
1537
1538static SIMPLE_DEV_PM_OPS(abituguru_pm, abituguru_suspend, abituguru_resume);
1539#define ABIT_UGURU_PM &abituguru_pm
1537#else 1540#else
1538#define abituguru_suspend NULL 1541#define ABIT_UGURU_PM NULL
1539#define abituguru_resume NULL
1540#endif /* CONFIG_PM */ 1542#endif /* CONFIG_PM */
1541 1543
1542static struct platform_driver abituguru_driver = { 1544static struct platform_driver abituguru_driver = {
1543 .driver = { 1545 .driver = {
1544 .owner = THIS_MODULE, 1546 .owner = THIS_MODULE,
1545 .name = ABIT_UGURU_NAME, 1547 .name = ABIT_UGURU_NAME,
1548 .pm = ABIT_UGURU_PM,
1546 }, 1549 },
1547 .probe = abituguru_probe, 1550 .probe = abituguru_probe,
1548 .remove = __devexit_p(abituguru_remove), 1551 .remove = __devexit_p(abituguru_remove),
1549 .suspend = abituguru_suspend,
1550 .resume = abituguru_resume,
1551}; 1552};
1552 1553
1553static int __init abituguru_detect(void) 1554static int __init abituguru_detect(void)