linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: [trivial]Remove unnecesary return
@ 2012-06-19 18:22 Devendra Naga
  2012-06-20  5:24 ` Bryan Wu
  0 siblings, 1 reply; 2+ messages in thread
From: Devendra Naga @ 2012-06-19 18:22 UTC (permalink / raw)
  To: Bryan Wu, Richard Purdie, Jiri Kosina, linux-leds, linux-kernel
  Cc: 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.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---

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(-)

diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index bd0a5ed..e6ee105 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] leds: [trivial]Remove unnecesary return
  2012-06-19 18:22 [PATCH] leds: [trivial]Remove unnecesary return Devendra Naga
@ 2012-06-20  5:24 ` Bryan Wu
  0 siblings, 0 replies; 2+ messages in thread
From: Bryan Wu @ 2012-06-20  5:24 UTC (permalink / raw)
  To: Devendra Naga; +Cc: Richard Purdie, Jiri Kosina, linux-leds, linux-kernel

On Wed, Jun 20, 2012 at 2:22 AM, Devendra Naga <devendra.aaru@gmail.com> wrote:
> 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.
>
> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>

Thanks, applied to my for-next branch.

-Bryan

> ---
>
> 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(-)
>
> diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
> index bd0a5ed..e6ee105 100644
> --- a/drivers/leds/leds-s3c24xx.c
> +++ b/drivers/leds/leds-s3c24xx.c
> @@ -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



-- 
Bryan Wu <bryan.wu@canonical.com>
Kernel Developer    +86.186-168-78255 Mobile
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-20  5:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-19 18:22 [PATCH] leds: [trivial]Remove unnecesary return Devendra Naga
2012-06-20  5:24 ` Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).