aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/abituguru3.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 16:29:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 16:29:18 -0400
commit0cd5ff591ab6473355d5a6a47f7694def28e451d (patch)
treeaed0ea4fbb724f13208ed76d438518ffc9130a17 /drivers/hwmon/abituguru3.c
parent3539fc544f39017cf3403b9319fb4d74b5116135 (diff)
parente30bca12573fbf54e2470723aadc047549d147ce (diff)
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: "New drivers for DA9052/53 PMIC as well as HIH-6130/HIH-6131 humidity and temperature sensors. Convert drivers to use devm_ functions and to use dev_pm_ops. Address a couple of Coverity errors/warnings as well as compile warnings. Some functional improvements in applesmc driver." * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (72 commits) hwmon: (applesmc) Ignore some temperature registers hwmon: (applesmc) Allow negative temperature values hwmon: (s3c-hwmon) Use devm_kzalloc instead of kzalloc hwmon: (w83781d) Fix compile warning hwmon: (applesmc) Shorten minimum wait time hwmon: (exynos4_tmu) Use struct dev_pm_ops for power management hwmon: (gpio-fan) Use struct dev_pm_ops for power management hwmon: (abituguru3) Use struct dev_pm_ops for power management hwmon: (abituguru) Use struct dev_pm_ops for power management hwmon: (acpi_power_meter) Fix unintentional integer overflow hwmon: (acpi_power_meter) Cleanup and optimizations hwmon: Honeywell Humidicon HIH-6130/HIH-6131 humidity and temperature sensor driver hwmon: (applesmc) Skip sensor mapping hwmon: (ntc_thermistor) Ensure that data->name string is terminated hwmon: (w83l785ts) Convert to use devm_ functions hwmon: (w83l785ts) Simplify code and improve readability hwmon: (smsc47m192) Convert to use devm_ functions hwmon: (smsc47m1) Convert to use devm_ functions hwmon: (smsc47b397) Convert to use devm_ functions hwmon: (k8temp) Convert to use devm_ functions ...
Diffstat (limited to 'drivers/hwmon/abituguru3.c')
-rw-r--r--drivers/hwmon/abituguru3.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index a5bc4287daa6..5d582aebff87 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -1141,10 +1141,10 @@ LEAVE_UPDATE:
1141 return NULL; 1141 return NULL;
1142} 1142}
1143 1143
1144#ifdef CONFIG_PM 1144#ifdef CONFIG_PM_SLEEP
1145static int abituguru3_suspend(struct platform_device *pdev, pm_message_t state) 1145static int abituguru3_suspend(struct device *dev)
1146{ 1146{
1147 struct abituguru3_data *data = platform_get_drvdata(pdev); 1147 struct abituguru3_data *data = dev_get_drvdata(dev);
1148 /* 1148 /*
1149 * make sure all communications with the uguru3 are done and no new 1149 * make sure all communications with the uguru3 are done and no new
1150 * ones are started 1150 * ones are started
@@ -1153,26 +1153,27 @@ static int abituguru3_suspend(struct platform_device *pdev, pm_message_t state)
1153 return 0; 1153 return 0;
1154} 1154}
1155 1155
1156static int abituguru3_resume(struct platform_device *pdev) 1156static int abituguru3_resume(struct device *dev)
1157{ 1157{
1158 struct abituguru3_data *data = platform_get_drvdata(pdev); 1158 struct abituguru3_data *data = dev_get_drvdata(dev);
1159 mutex_unlock(&data->update_lock); 1159 mutex_unlock(&data->update_lock);
1160 return 0; 1160 return 0;
1161} 1161}
1162
1163static SIMPLE_DEV_PM_OPS(abituguru3_pm, abituguru3_suspend, abituguru3_resume);
1164#define ABIT_UGURU3_PM &abituguru3_pm
1162#else 1165#else
1163#define abituguru3_suspend NULL 1166#define ABIT_UGURU3_PM NULL
1164#define abituguru3_resume NULL
1165#endif /* CONFIG_PM */ 1167#endif /* CONFIG_PM */
1166 1168
1167static struct platform_driver abituguru3_driver = { 1169static struct platform_driver abituguru3_driver = {
1168 .driver = { 1170 .driver = {
1169 .owner = THIS_MODULE, 1171 .owner = THIS_MODULE,
1170 .name = ABIT_UGURU3_NAME, 1172 .name = ABIT_UGURU3_NAME,
1173 .pm = ABIT_UGURU3_PM
1171 }, 1174 },
1172 .probe = abituguru3_probe, 1175 .probe = abituguru3_probe,
1173 .remove = __devexit_p(abituguru3_remove), 1176 .remove = __devexit_p(abituguru3_remove),
1174 .suspend = abituguru3_suspend,
1175 .resume = abituguru3_resume
1176}; 1177};
1177 1178
1178static int __init abituguru3_dmi_detect(void) 1179static int __init abituguru3_dmi_detect(void)