aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-06-02 14:20:21 -0400
committerGuenter Roeck <linux@roeck-us.net>2012-09-24 00:08:32 -0400
commitbd8d8e088d4ec8738d47141c119013b5e63f591c (patch)
tree7a56cf0d8ae04babc46d93317760d59a5fa1b389
parent79831fd4e0820bdc882d08707e4650ed4dfff3b8 (diff)
hwmon: (sch5627) Convert to use devm_ functions
Convert to use devm_ functions to reduce code size and simplify the code. Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/sch5627.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hwmon/sch5627.c b/drivers/hwmon/sch5627.c
index 8342275378b8..49f6230bdcf1 100644
--- a/drivers/hwmon/sch5627.c
+++ b/drivers/hwmon/sch5627.c
@@ -461,8 +461,6 @@ static int sch5627_remove(struct platform_device *pdev)
461 hwmon_device_unregister(data->hwmon_dev); 461 hwmon_device_unregister(data->hwmon_dev);
462 462
463 sysfs_remove_group(&pdev->dev.kobj, &sch5627_group); 463 sysfs_remove_group(&pdev->dev.kobj, &sch5627_group);
464 platform_set_drvdata(pdev, NULL);
465 kfree(data);
466 464
467 return 0; 465 return 0;
468} 466}
@@ -472,7 +470,8 @@ static int __devinit sch5627_probe(struct platform_device *pdev)
472 struct sch5627_data *data; 470 struct sch5627_data *data;
473 int err, build_code, build_id, hwmon_rev, val; 471 int err, build_code, build_id, hwmon_rev, val;
474 472
475 data = kzalloc(sizeof(struct sch5627_data), GFP_KERNEL); 473 data = devm_kzalloc(&pdev->dev, sizeof(struct sch5627_data),
474 GFP_KERNEL);
476 if (!data) 475 if (!data)
477 return -ENOMEM; 476 return -ENOMEM;
478 477