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