summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAxel Lin2011-05-01 17:34:55 +0200
committerGuenter Roeck2011-05-01 18:06:35 +0200
commitc30aa39c233ca1df8397eb9e9c8b40a397ce72bb (patch)
treeec550c54d08f245c717587bc4bae228ffe75090b /drivers/hwmon
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 (diff)
downloadkernel-qcow2-linux-c30aa39c233ca1df8397eb9e9c8b40a397ce72bb.tar.gz
kernel-qcow2-linux-c30aa39c233ca1df8397eb9e9c8b40a397ce72bb.tar.xz
kernel-qcow2-linux-c30aa39c233ca1df8397eb9e9c8b40a397ce72bb.zip
hwmon: (twl4030-madc-hwmon) Return proper error if hwmon_device_register fails
The driver did not return an error if the call to hwmon_device_register failed. Fix by returning the error reported from hwmon_device_register. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/twl4030-madc-hwmon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hwmon/twl4030-madc-hwmon.c b/drivers/hwmon/twl4030-madc-hwmon.c
index de5819199e2e..57240740b161 100644
--- a/drivers/hwmon/twl4030-madc-hwmon.c
+++ b/drivers/hwmon/twl4030-madc-hwmon.c
@@ -98,7 +98,6 @@ static const struct attribute_group twl4030_madc_group = {
static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev)
{
int ret;
- int status;
struct device *hwmon;
ret = sysfs_create_group(&pdev->dev.kobj, &twl4030_madc_group);
@@ -107,7 +106,7 @@ static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev)
hwmon = hwmon_device_register(&pdev->dev);
if (IS_ERR(hwmon)) {
dev_err(&pdev->dev, "hwmon_device_register failed.\n");
- status = PTR_ERR(hwmon);
+ ret = PTR_ERR(hwmon);
goto err_reg;
}