aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/abituguru.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/abituguru.c')
-rw-r--r--drivers/hwmon/abituguru.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index bede4d990ea6..11a40da13535 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1287,6 +1287,7 @@ abituguru_probe_error:
1287 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) 1287 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
1288 device_remove_file(&pdev->dev, 1288 device_remove_file(&pdev->dev,
1289 &abituguru_sysfs_attr[i].dev_attr); 1289 &abituguru_sysfs_attr[i].dev_attr);
1290 platform_set_drvdata(pdev, NULL);
1290 kfree(data); 1291 kfree(data);
1291 return res; 1292 return res;
1292} 1293}
@@ -1296,13 +1297,13 @@ static int __devexit abituguru_remove(struct platform_device *pdev)
1296 int i; 1297 int i;
1297 struct abituguru_data *data = platform_get_drvdata(pdev); 1298 struct abituguru_data *data = platform_get_drvdata(pdev);
1298 1299
1299 platform_set_drvdata(pdev, NULL);
1300 hwmon_device_unregister(data->class_dev); 1300 hwmon_device_unregister(data->class_dev);
1301 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++) 1301 for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
1302 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr); 1302 device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
1303 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) 1303 for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
1304 device_remove_file(&pdev->dev, 1304 device_remove_file(&pdev->dev,
1305 &abituguru_sysfs_attr[i].dev_attr); 1305 &abituguru_sysfs_attr[i].dev_attr);
1306 platform_set_drvdata(pdev, NULL);
1306 kfree(data); 1307 kfree(data);
1307 1308
1308 return 0; 1309 return 0;