Skip to contentSkip to conversation

gpio led: properly initialize return value

PATCH In review Davidlohr Bueso 1 participant 2 messages Oct 18, 2010 – Oct 21, 2010 LED

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio led: properly initialize return value

gpio led: properly initialize return value in gpio_led_init()

In the event that none of the configs are set (CONFIG_LEDS_GPIO_PLATFORM, CONFIG_LEDS_GPIO_OF, CONFIG_LEDS_GPIO_PLATFORM), we will return bogus when initializing the module.

---
 drivers/leds/leds-gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/leds-gpio.c +1 -1
index ea57e05..4d9fa38 100644
@@ -316,7 +316,7 @@ static struct of_platform_driver of_gpio_leds_driver = {
 
 static int __init gpio_led_init(void)
 {
-	int ret;
+	int ret = 0;
 
 #ifdef CONFIG_LEDS_GPIO_PLATFORM	
 	ret = platform_driver_register(&gpio_led_driver);
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 5 lines · Davidlohr Bueso

gpio led: properly initialize return value in gpio_led_init()

In the event that none of the configs are set (CONFIG_LEDS_GPIO_PLATFORM, CONFIG_LEDS_GPIO_OF, CONFIG_LEDS_GPIO_PLATFORM), we will return bogus when initializing the module.

Quoted 18 lines
---
 drivers/leds/leds-gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/leds-gpio.c +1 -1
index ea57e05..4d9fa38 100644
@@ -316,7 +316,7 @@ static struct of_platform_driver of_gpio_leds_driver = {
 
 static int __init gpio_led_init(void)
 {
-	int ret;
+	int ret = 0;
 
 #ifdef CONFIG_LEDS_GPIO_PLATFORM	
 	ret = platform_driver_register(&gpio_led_driver);