Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315967
b: refs/heads/master
c: e7d5bf7
h: refs/heads/master
i:
  315965: f956ef4
  315963: 0e88d12
  315959: 38a3384
  315951: 8f6312f
  315935: 1be0474
  315903: 4d9d6a2
v: v3
  • Loading branch information
Guenter Roeck committed Jul 22, 2012
1 parent 6bf762e commit c822396
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e41f6432d1ca757d8e4a2dccfd772e421d640e98
refs/heads/master: e7d5bf7ed59ce26d3e6fc12ada497f42efd393ef
9 changes: 3 additions & 6 deletions trunk/drivers/hwmon/wm831x-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,16 @@ static int __devinit wm831x_hwmon_probe(struct platform_device *pdev)
struct wm831x_hwmon *hwmon;
int ret;

hwmon = kzalloc(sizeof(struct wm831x_hwmon), GFP_KERNEL);
hwmon = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_hwmon),
GFP_KERNEL);
if (!hwmon)
return -ENOMEM;

hwmon->wm831x = wm831x;

ret = sysfs_create_group(&pdev->dev.kobj, &wm831x_attr_group);
if (ret)
goto err;
return ret;

hwmon->classdev = hwmon_device_register(&pdev->dev);
if (IS_ERR(hwmon->classdev)) {
Expand All @@ -185,8 +186,6 @@ static int __devinit wm831x_hwmon_probe(struct platform_device *pdev)

err_sysfs:
sysfs_remove_group(&pdev->dev.kobj, &wm831x_attr_group);
err:
kfree(hwmon);
return ret;
}

Expand All @@ -196,8 +195,6 @@ static int __devexit wm831x_hwmon_remove(struct platform_device *pdev)

hwmon_device_unregister(hwmon->classdev);
sysfs_remove_group(&pdev->dev.kobj, &wm831x_attr_group);
platform_set_drvdata(pdev, NULL);
kfree(hwmon);

return 0;
}
Expand Down

0 comments on commit c822396

Please sign in to comment.