mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
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>
This commit is contained in:
parent
1be6a1f89f
commit
c30aa39c23
1 changed files with 1 additions and 2 deletions
|
@ -98,7 +98,6 @@ static const struct attribute_group twl4030_madc_group = {
|
||||||
static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev)
|
static int __devinit twl4030_madc_hwmon_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int status;
|
|
||||||
struct device *hwmon;
|
struct device *hwmon;
|
||||||
|
|
||||||
ret = sysfs_create_group(&pdev->dev.kobj, &twl4030_madc_group);
|
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);
|
hwmon = hwmon_device_register(&pdev->dev);
|
||||||
if (IS_ERR(hwmon)) {
|
if (IS_ERR(hwmon)) {
|
||||||
dev_err(&pdev->dev, "hwmon_device_register failed.\n");
|
dev_err(&pdev->dev, "hwmon_device_register failed.\n");
|
||||||
status = PTR_ERR(hwmon);
|
ret = PTR_ERR(hwmon);
|
||||||
goto err_reg;
|
goto err_reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue