提交 9220f1e4 编写于 作者: G Guenter Roeck

hwmon: (sch5636) Convert to use devm_ functions

Convert to use devm_ functions to reduce code size and simplify the code.
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
上级 bd8d8e08
...@@ -402,9 +402,6 @@ static int sch5636_remove(struct platform_device *pdev) ...@@ -402,9 +402,6 @@ static int sch5636_remove(struct platform_device *pdev)
device_remove_file(&pdev->dev, device_remove_file(&pdev->dev,
&sch5636_fan_attr[i].dev_attr); &sch5636_fan_attr[i].dev_attr);
platform_set_drvdata(pdev, NULL);
kfree(data);
return 0; return 0;
} }
...@@ -414,7 +411,8 @@ static int __devinit sch5636_probe(struct platform_device *pdev) ...@@ -414,7 +411,8 @@ static int __devinit sch5636_probe(struct platform_device *pdev)
int i, err, val, revision[2]; int i, err, val, revision[2];
char id[4]; char id[4];
data = kzalloc(sizeof(struct sch5636_data), GFP_KERNEL); data = devm_kzalloc(&pdev->dev, sizeof(struct sch5636_data),
GFP_KERNEL);
if (!data) if (!data)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册