power: generic-adc-battery: return meaningful error when no channel available

A patch from »power: generic-adc-battery: use devm_kcalloc for psy->properties« in state Rework for linux-kernel

From: Heiko Stuebner <heiko.stuebner@...> Date: Thu, 8 May 2014 17:50:05 +0200

Commit-Message

From: Heiko Stuebner <heiko.stuebner@...> 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@...>

Patch-Comment

drivers/power/generic-adc-battery.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

Statistics

  • 1 lines added
  • 3 lines removed

Changes

--------------------- drivers/power/generic-adc-battery.c ----------------------
index 540d57f..02f434b 100644
@@ -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
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...