summaryrefslogtreecommitdiff
path: root/drivers/hwmon/w83791d.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 20:29:18 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-24 20:29:18 (GMT)
commit0cd5ff591ab6473355d5a6a47f7694def28e451d (patch)
treeaed0ea4fbb724f13208ed76d438518ffc9130a17 /drivers/hwmon/w83791d.c
parent3539fc544f39017cf3403b9319fb4d74b5116135 (diff)
parente30bca12573fbf54e2470723aadc047549d147ce (diff)
downloadlinux-fsl-qoriq-0cd5ff591ab6473355d5a6a47f7694def28e451d.tar.xz
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/w83791d.c')
-rw-r--r--drivers/hwmon/w83791d.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/hwmon/w83791d.c b/drivers/hwmon/w83791d.c
index 2f446f9..9ade4d4 100644
--- a/drivers/hwmon/w83791d.c
+++ b/drivers/hwmon/w83791d.c
@@ -1384,18 +1384,17 @@ static int w83791d_probe(struct i2c_client *client,
(val1 >> 5) & 0x07, (val1 >> 1) & 0x0f, val1);
#endif
- data = kzalloc(sizeof(struct w83791d_data), GFP_KERNEL);
- if (!data) {
- err = -ENOMEM;
- goto error0;
- }
+ data = devm_kzalloc(&client->dev, sizeof(struct w83791d_data),
+ GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
i2c_set_clientdata(client, data);
mutex_init(&data->update_lock);
err = w83791d_detect_subclients(client);
if (err)
- goto error1;
+ return err;
/* Initialize the chip */
w83791d_init_client(client);
@@ -1440,9 +1439,6 @@ error3:
i2c_unregister_device(data->lm75[0]);
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
-error1:
- kfree(data);
-error0:
return err;
}
@@ -1458,7 +1454,6 @@ static int w83791d_remove(struct i2c_client *client)
if (data->lm75[1] != NULL)
i2c_unregister_device(data->lm75[1]);
- kfree(data);
return 0;
}