diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-06-02 12:57:56 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2012-09-24 00:08:29 -0400 |
commit | d8f30ad8e556cad5ee23fdb63845914aec4a8172 (patch) | |
tree | 1bc22399e252290be637f3cdd9c2542f3f2b4141 /drivers/hwmon/abituguru.c | |
parent | 313829ee3cccbc658409357f32a1508620b60142 (diff) |
hwmon: (abituguru) 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>
Diffstat (limited to 'drivers/hwmon/abituguru.c')
-rw-r--r-- | drivers/hwmon/abituguru.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c index d4419b47f3d4..78b81793ddd9 100644 --- a/drivers/hwmon/abituguru.c +++ b/drivers/hwmon/abituguru.c | |||
@@ -1278,7 +1278,8 @@ static int __devinit abituguru_probe(struct platform_device *pdev) | |||
1278 | 0x00, 0x01, 0x03, 0x04, 0x0A, 0x08, 0x0E, 0x02, | 1278 | 0x00, 0x01, 0x03, 0x04, 0x0A, 0x08, 0x0E, 0x02, |
1279 | 0x09, 0x06, 0x05, 0x0B, 0x0F, 0x0D, 0x07, 0x0C }; | 1279 | 0x09, 0x06, 0x05, 0x0B, 0x0F, 0x0D, 0x07, 0x0C }; |
1280 | 1280 | ||
1281 | data = kzalloc(sizeof(struct abituguru_data), GFP_KERNEL); | 1281 | data = devm_kzalloc(&pdev->dev, sizeof(struct abituguru_data), |
1282 | GFP_KERNEL); | ||
1282 | if (!data) | 1283 | if (!data) |
1283 | return -ENOMEM; | 1284 | return -ENOMEM; |
1284 | 1285 | ||
@@ -1430,8 +1431,6 @@ abituguru_probe_error: | |||
1430 | for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) | 1431 | for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) |
1431 | device_remove_file(&pdev->dev, | 1432 | device_remove_file(&pdev->dev, |
1432 | &abituguru_sysfs_attr[i].dev_attr); | 1433 | &abituguru_sysfs_attr[i].dev_attr); |
1433 | platform_set_drvdata(pdev, NULL); | ||
1434 | kfree(data); | ||
1435 | return res; | 1434 | return res; |
1436 | } | 1435 | } |
1437 | 1436 | ||
@@ -1446,8 +1445,6 @@ static int __devexit abituguru_remove(struct platform_device *pdev) | |||
1446 | for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) | 1445 | for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) |
1447 | device_remove_file(&pdev->dev, | 1446 | device_remove_file(&pdev->dev, |
1448 | &abituguru_sysfs_attr[i].dev_attr); | 1447 | &abituguru_sysfs_attr[i].dev_attr); |
1449 | platform_set_drvdata(pdev, NULL); | ||
1450 | kfree(data); | ||
1451 | 1448 | ||
1452 | return 0; | 1449 | return 0; |
1453 | } | 1450 | } |