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>

authored by Axel Lin and committed by Guenter Roeck c30aa39c 1be6a1f8

+1 -2
+1 -2
drivers/hwmon/twl4030-madc-hwmon.c
··· 98 static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev) 99 { 100 int ret; 101 - int status; 102 struct device *hwmon; 103 104 ret = sysfs_create_group(&pdev->dev.kobj, &twl4030_madc_group); ··· 106 hwmon = hwmon_device_register(&pdev->dev); 107 if (IS_ERR(hwmon)) { 108 dev_err(&pdev->dev, "hwmon_device_register failed.\n"); 109 - status = PTR_ERR(hwmon); 110 goto err_reg; 111 } 112
··· 98 static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev) 99 { 100 int ret; 101 struct device *hwmon; 102 103 ret = sysfs_create_group(&pdev->dev.kobj, &twl4030_madc_group); ··· 107 hwmon = hwmon_device_register(&pdev->dev); 108 if (IS_ERR(hwmon)) { 109 dev_err(&pdev->dev, "hwmon_device_register failed.\n"); 110 + ret = PTR_ERR(hwmon); 111 goto err_reg; 112 } 113