diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 13:29:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-24 13:29:18 -0700 |
commit | 0cd5ff591ab6473355d5a6a47f7694def28e451d (patch) | |
tree | aed0ea4fbb724f13208ed76d438518ffc9130a17 /drivers/hwmon/max1619.c | |
parent | 3539fc544f39017cf3403b9319fb4d74b5116135 (diff) | |
parent | e30bca12573fbf54e2470723aadc047549d147ce (diff) | |
download | op-kernel-dev-0cd5ff591ab6473355d5a6a47f7694def28e451d.zip op-kernel-dev-0cd5ff591ab6473355d5a6a47f7694def28e451d.tar.gz |
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/max1619.c')
-rw-r--r-- | drivers/hwmon/max1619.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index ecac04a7..6c11ec2 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c @@ -267,11 +267,10 @@ static int max1619_probe(struct i2c_client *new_client, struct max1619_data *data; int err; - data = kzalloc(sizeof(struct max1619_data), GFP_KERNEL); - if (!data) { - err = -ENOMEM; - goto exit; - } + data = devm_kzalloc(&new_client->dev, sizeof(struct max1619_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; i2c_set_clientdata(new_client, data); data->valid = 0; @@ -283,7 +282,7 @@ static int max1619_probe(struct i2c_client *new_client, /* Register sysfs hooks */ err = sysfs_create_group(&new_client->dev.kobj, &max1619_group); if (err) - goto exit_free; + return err; data->hwmon_dev = hwmon_device_register(&new_client->dev); if (IS_ERR(data->hwmon_dev)) { @@ -295,9 +294,6 @@ static int max1619_probe(struct i2c_client *new_client, exit_remove_files: sysfs_remove_group(&new_client->dev.kobj, &max1619_group); -exit_free: - kfree(data); -exit: return err; } @@ -323,7 +319,6 @@ static int max1619_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&client->dev.kobj, &max1619_group); - kfree(data); return 0; } |