Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305859
b: refs/heads/master
c: 41141e6
h: refs/heads/master
i:
  305857: 28b9d92
  305855: 9128122
v: v3
  • Loading branch information
Guenter Roeck committed May 21, 2012
1 parent c75a1c3 commit 468c8ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 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: 1137a9a649db818869905b010b120a95a01b0d24
refs/heads/master: 41141e64e63dd250a05218b66c91e125f1020b92
11 changes: 3 additions & 8 deletions trunk/drivers/hwmon/ntc_thermistor.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ static int __devinit ntc_thermistor_probe(struct platform_device *pdev)
return -EINVAL;
}

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

Expand All @@ -370,16 +370,15 @@ static int __devinit ntc_thermistor_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Unknown device type: %lu(%s)\n",
pdev->id_entry->driver_data,
pdev->id_entry->name);
ret = -EINVAL;
goto err;
return -EINVAL;
}

platform_set_drvdata(pdev, data);

ret = sysfs_create_group(&data->dev->kobj, &ntc_attr_group);
if (ret) {
dev_err(data->dev, "unable to create sysfs files\n");
goto err;
return ret;
}

data->hwmon_dev = hwmon_device_register(data->dev);
Expand All @@ -395,8 +394,6 @@ static int __devinit ntc_thermistor_probe(struct platform_device *pdev)
return 0;
err_after_sysfs:
sysfs_remove_group(&data->dev->kobj, &ntc_attr_group);
err:
kfree(data);
return ret;
}

Expand All @@ -408,8 +405,6 @@ static int __devexit ntc_thermistor_remove(struct platform_device *pdev)
sysfs_remove_group(&data->dev->kobj, &ntc_attr_group);
platform_set_drvdata(pdev, NULL);

kfree(data);

return 0;
}

Expand Down

0 comments on commit 468c8ff

Please sign in to comment.