From: Heiko Stuebner <[email protected]>

When no channel was found the driver currently always returns -ENODEV. This
hides the actual error which is available in ret from the kernel and disables
for example -EPROBE_DEFER handling.

Signed-off-by: Heiko Stuebner <[email protected]>
---
 drivers/power/generic-adc-battery.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/power/generic-adc-battery.c 
b/drivers/power/generic-adc-battery.c
index 540d57f..02f434b 100644
--- a/drivers/power/generic-adc-battery.c
+++ b/drivers/power/generic-adc-battery.c
@@ -297,10 +297,8 @@ static int gab_probe(struct platform_device *pdev)
        }
 
        /* none of the channels are supported so let's bail out */
-       if (index == 0) {
-               ret = -ENODEV;
+       if (index == 0)
                return ret;
-       }
 
        /*
         * Total number of properties is equal to static properties
-- 
1.9.0


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

Reply via email to