[PATCH 2/2] power: generic-adc-battery: return meaningful error when no channel available

From: Heiko Stübner
Date: Fri May 16 2014 - 09:10:55 EST


From: Heiko Stuebner <heiko.stuebner@xxxxxx>

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 <heiko.stuebner@xxxxxx>
---
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/