From c822396987e5cb69463d29c39e34984c21f80ce5 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sat, 2 Jun 2012 11:48:02 -0700 Subject: [PATCH] --- yaml --- r: 315967 b: refs/heads/master c: e7d5bf7ed59ce26d3e6fc12ada497f42efd393ef h: refs/heads/master i: 315965: f956ef430e9a8fd99c7652c08765200352e608b7 315963: 0e88d12fac19509c8111da03cd6e7caa474facb1 315959: 38a3384cc3e42b3dae34f4a42eb2640b9554970d 315951: 8f6312f50a321905b20526dd6771fa02f599422a 315935: 1be0474c35dce08fbbcfe69e3062b39d7787856a 315903: 4d9d6a2cf95000c0b562bd7ff0caed8358d8250d v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/wm831x-hwmon.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 8ef6a35493b7..9a55d1a79c3e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e41f6432d1ca757d8e4a2dccfd772e421d640e98 +refs/heads/master: e7d5bf7ed59ce26d3e6fc12ada497f42efd393ef diff --git a/trunk/drivers/hwmon/wm831x-hwmon.c b/trunk/drivers/hwmon/wm831x-hwmon.c index 07cb25ae69be..d0db1f2738fb 100644 --- a/trunk/drivers/hwmon/wm831x-hwmon.c +++ b/trunk/drivers/hwmon/wm831x-hwmon.c @@ -163,7 +163,8 @@ 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; @@ -171,7 +172,7 @@ static int __devinit wm831x_hwmon_probe(struct platform_device *pdev) 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)) { @@ -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; } @@ -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; }