Re: [PATCH] hwmon: fix error return code in abituguru_probe()

2013-05-13 Thread Guenter Roeck
On Mon, May 13, 2013 at 02:01:43PM +0800, Wei Yongjun wrote:
> From: Wei Yongjun 
> 
> Fix to return a negative error code from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun 

Applied.

Thanks,
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hwmon: fix error return code in abituguru_probe()

2013-05-13 Thread Wei Yongjun
From: Wei Yongjun 

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun 
---
 drivers/hwmon/abituguru.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index df0b699..2ebd6ce 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1414,14 +1414,18 @@ static int abituguru_probe(struct platform_device *pdev)
pr_info("found Abit uGuru\n");
 
/* Register sysfs hooks */
-   for (i = 0; i < sysfs_attr_i; i++)
-   if (device_create_file(>dev,
-   >sysfs_attr[i].dev_attr))
+   for (i = 0; i < sysfs_attr_i; i++) {
+   res = device_create_file(>dev,
+>sysfs_attr[i].dev_attr);
+   if (res)
goto abituguru_probe_error;
-   for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++)
-   if (device_create_file(>dev,
-   _sysfs_attr[i].dev_attr))
+   }
+   for (i = 0; i < ARRAY_SIZE(abituguru_sysfs_attr); i++) {
+   res = device_create_file(>dev,
+_sysfs_attr[i].dev_attr);
+   if (res)
goto abituguru_probe_error;
+   }
 
data->hwmon_dev = hwmon_device_register(>dev);
if (!IS_ERR(data->hwmon_dev))

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] hwmon: fix error return code in abituguru_probe()

2013-05-13 Thread Wei Yongjun
From: Wei Yongjun yongjun_...@trendmicro.com.cn

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
---
 drivers/hwmon/abituguru.c | 16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index df0b699..2ebd6ce 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1414,14 +1414,18 @@ static int abituguru_probe(struct platform_device *pdev)
pr_info(found Abit uGuru\n);
 
/* Register sysfs hooks */
-   for (i = 0; i  sysfs_attr_i; i++)
-   if (device_create_file(pdev-dev,
-   data-sysfs_attr[i].dev_attr))
+   for (i = 0; i  sysfs_attr_i; i++) {
+   res = device_create_file(pdev-dev,
+data-sysfs_attr[i].dev_attr);
+   if (res)
goto abituguru_probe_error;
-   for (i = 0; i  ARRAY_SIZE(abituguru_sysfs_attr); i++)
-   if (device_create_file(pdev-dev,
-   abituguru_sysfs_attr[i].dev_attr))
+   }
+   for (i = 0; i  ARRAY_SIZE(abituguru_sysfs_attr); i++) {
+   res = device_create_file(pdev-dev,
+abituguru_sysfs_attr[i].dev_attr);
+   if (res)
goto abituguru_probe_error;
+   }
 
data-hwmon_dev = hwmon_device_register(pdev-dev);
if (!IS_ERR(data-hwmon_dev))

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] hwmon: fix error return code in abituguru_probe()

2013-05-13 Thread Guenter Roeck
On Mon, May 13, 2013 at 02:01:43PM +0800, Wei Yongjun wrote:
 From: Wei Yongjun yongjun_...@trendmicro.com.cn
 
 Fix to return a negative error code from the error handling
 case instead of 0, as done elsewhere in this function.
 
 Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn

Applied.

Thanks,
Guenter
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/