Re: leds: just ignore invalid GPIOs in leds-gpio

From: David Brownell
Date: Tue Apr 07 2009 - 20:52:01 EST


On Tuesday 07 April 2009, Geert Uytterhoeven wrote:
> | drivers/leds/leds-gpio.c:85: warning: 'return' with no value, in function
> | returning non-void
>
> So what should we return here? -ENODEV? -EINVAL? Anything else?

Success: 0. The point is to ignore them, not fail!


See the appended.

- Dave

========== CUT HERE
From: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

Fix build problems with leds-gpio:

CC drivers/leds/leds-gpio.o
drivers/leds/leds-gpio.c: In function 'create_gpio_led':
drivers/leds/leds-gpio.c:85: warning: 'return' with no value, in function returning non-void

Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>

---
drivers/leds/leds-gpio.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -82,7 +84,7 @@ static int __devinit create_gpio_led(con
if (!gpio_is_valid(template->gpio)) {
printk(KERN_INFO "Skipping unavilable LED gpio %d (%s)\n",
template->gpio, template->name);
- return;
+ return 0;
}

ret = gpio_request(template->gpio, template->name);

--
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/