提交 a34c26d8 编写于 作者: G Guenter Roeck

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: NGuenter Roeck <linux@roeck-us.net>
上级 d8f30ad8
......@@ -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 @@ static int __devinit abituguru3_probe(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 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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册