diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-06-02 18:57:57 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-09-24 06:08:29 +0200 |
commit | a34c26d8e288d48e70c0e722da0c745e14d74e3a (patch) | |
tree | 9cecfc69b111e77a300e6239ad4d551e11919d6a /drivers/hwmon/abituguru3.c | |
parent | hwmon: (abituguru) Convert to use devm_ functions (diff) | |
download | linux-a34c26d8e288d48e70c0e722da0c745e14d74e3a.tar.xz linux-a34c26d8e288d48e70c0e722da0c745e14d74e3a.zip |
hwmon: (abituguru3) 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>
Cc: Alistair John Strachan <alistair@devzero.co.uk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/abituguru3.c')
-rw-r--r-- | drivers/hwmon/abituguru3.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c index 5d582aebff87..b174b8b2b4df 100644 --- a/drivers/hwmon/abituguru3.c +++ b/drivers/hwmon/abituguru3.c @@ -976,7 +976,8 @@ static int __devinit abituguru3_probe(struct platform_device *pdev) u8 buf[2]; u16 id; - data = kzalloc(sizeof(struct abituguru3_data), GFP_KERNEL); + data = devm_kzalloc(&pdev->dev, sizeof(struct abituguru3_data), + GFP_KERNEL); if (!data) return -ENOMEM; @@ -1068,7 +1069,6 @@ abituguru3_probe_error: for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++) device_remove_file(&pdev->dev, &abituguru3_sysfs_attr[i].dev_attr); - kfree(data); return res; } @@ -1084,8 +1084,6 @@ static int __devexit abituguru3_remove(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++) device_remove_file(&pdev->dev, &abituguru3_sysfs_attr[i].dev_attr); - kfree(data); - return 0; } |