Skip to contentSkip to conversation

leds: [trivial]Remove unnecesary return

PATCH Applied Devendra Naga 2 participants 2 messages Jun 19, 2012 – Jun 20, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds: [trivial]Remove unnecesary return

the ret is got the status returned by the led_classdev_register, returning ret if the led_classdev_register fails and returning 0 if the led_classdev_register success, can be done by doing just "return ret" at the end.

---

Tested by build with the gcc linaro (arm-linux-gnueabihf) (4.7.1).

 drivers/leds/leds-s3c24xx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/leds/leds-s3c24xx.c +0 -0
index bd0a5ed..e6ee105 100644
@@ -106,10 +106,9 @@ static int s3c24xx_led_probe(struct platform_device *dev)
	if (ret < 0) {
		dev_err(&dev->dev, "led_classdev_register failed\n");
		kfree(led);
-		return ret;
	}

- return 0;
+ return ret;
}

static struct platform_driver s3c24xx_led_driver = {
--
1.7.9.5

Applied
#1 lore raw
Quoted 7 lines · Devendra Naga

the ret is got the status returned by the led_classdev_register, returning ret if the led_classdev_register fails and returning 0 if the led_classdev_register success, can be done by doing just "return ret" at the end.

Thanks, applied to my for-next branch.

-Bryan

Quoted 25 lines

---

Tested by build with the gcc linaro (arm-linux-gnueabihf) (4.7.1).

 drivers/leds/leds-s3c24xx.c |    3 +--

 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/leds/leds-s3c24xx.c +1 -3
index bd0a5ed..e6ee105 100644
@@ -106,10 +106,9 @@ static int s3c24xx_led_probe(struct platform_device *dev)
        if (ret < 0) {
                dev_err(&dev->dev, "led_classdev_register failed\n");
                kfree(led);
-               return ret;
        }
 
-       return 0;
+       return ret;
  }
 
  static struct platform_driver s3c24xx_led_driver = {
--

1.7.9.5

Signature · 4 lines
Bryan Wu <[email protected]>
Kernel Developer    +86.186-168-78255 Mobile
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com