aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/max6650.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/max6650.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/max6650.c')
-rw-r--r--drivers/hwmon/max6650.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
index 33a8a7f15e18..f739f83bafb9 100644
--- a/drivers/hwmon/max6650.c
+++ b/drivers/hwmon/max6650.c
@@ -545,7 +545,8 @@ static int max6650_probe(struct i2c_client *client,
545 struct max6650_data *data; 545 struct max6650_data *data;
546 int err; 546 int err;
547 547
548 data = kzalloc(sizeof(struct max6650_data), GFP_KERNEL); 548 data = devm_kzalloc(&client->dev, sizeof(struct max6650_data),
549 GFP_KERNEL);
549 if (!data) { 550 if (!data) {
550 dev_err(&client->dev, "out of memory.\n"); 551 dev_err(&client->dev, "out of memory.\n");
551 return -ENOMEM; 552 return -ENOMEM;
@@ -560,11 +561,11 @@ static int max6650_probe(struct i2c_client *client,
560 */ 561 */
561 err = max6650_init_client(client); 562 err = max6650_init_client(client);
562 if (err) 563 if (err)
563 goto err_free; 564 return err;
564 565
565 err = sysfs_create_group(&client->dev.kobj, &max6650_attr_grp); 566 err = sysfs_create_group(&client->dev.kobj, &max6650_attr_grp);
566 if (err) 567 if (err)
567 goto err_free; 568 return err;
568 /* 3 additional fan inputs for the MAX6651 */ 569 /* 3 additional fan inputs for the MAX6651 */
569 if (data->nr_fans == 4) { 570 if (data->nr_fans == 4) {
570 err = sysfs_create_group(&client->dev.kobj, &max6651_attr_grp); 571 err = sysfs_create_group(&client->dev.kobj, &max6651_attr_grp);
@@ -582,8 +583,6 @@ static int max6650_probe(struct i2c_client *client,
582 sysfs_remove_group(&client->dev.kobj, &max6651_attr_grp); 583 sysfs_remove_group(&client->dev.kobj, &max6651_attr_grp);
583err_remove: 584err_remove:
584 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); 585 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp);
585err_free:
586 kfree(data);
587 return err; 586 return err;
588} 587}
589 588
@@ -595,7 +594,6 @@ static int max6650_remove(struct i2c_client *client)
595 if (data->nr_fans == 4) 594 if (data->nr_fans == 4)
596 sysfs_remove_group(&client->dev.kobj, &max6651_attr_grp); 595 sysfs_remove_group(&client->dev.kobj, &max6651_attr_grp);
597 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp); 596 sysfs_remove_group(&client->dev.kobj, &max6650_attr_grp);
598 kfree(data);
599 return 0; 597 return 0;
600} 598}
601 599