All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Fida Mohammad <fmthoker@gmail.com>
Cc: Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: leds-locomo.c: Use devm_led_classdev_register
Date: Mon, 19 Oct 2015 10:16:09 +0200	[thread overview]
Message-ID: <5624A6C9.8080806@samsung.com> (raw)
In-Reply-To: <1445031183-25326-1-git-send-email-fmthoker@gmail.com>

Hi Fida,

On 10/16/2015 11:33 PM, Fida Mohammad wrote:
> Use resource managed function devm_led_classdev_register to make
> initialisation path simpler.
> Also removed redundant led_classdev_unregister function.
>
> Signed-off-by: Fida Mohammad <fmthoker@gmail.com>
> ---
>   drivers/leds/leds-locomo.c | 15 ++-------------
>   1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/leds/leds-locomo.c b/drivers/leds/leds-locomo.c
> index 80ba048..24c4b53 100644
> --- a/drivers/leds/leds-locomo.c
> +++ b/drivers/leds/leds-locomo.c
> @@ -59,23 +59,13 @@ static int locomoled_probe(struct locomo_dev *ldev)
>   {
>   	int ret;
>
> -	ret = led_classdev_register(&ldev->dev, &locomo_led0);
> +	ret = devm_led_classdev_register(&ldev->dev, &locomo_led0);
>   	if (ret < 0)
>   		return ret;
>
> -	ret = led_classdev_register(&ldev->dev, &locomo_led1);
> -	if (ret < 0)
> -		led_classdev_unregister(&locomo_led0);
> -
> -	return ret;
> +	return  devm_led_classdev_register(&ldev->dev, &locomo_led1);
>   }
>
> -static int locomoled_remove(struct locomo_dev *dev)
> -{
> -	led_classdev_unregister(&locomo_led0);
> -	led_classdev_unregister(&locomo_led1);
> -	return 0;
> -}
>
>   static struct locomo_driver locomoled_driver = {
>   	.drv = {
> @@ -83,7 +73,6 @@ static struct locomo_driver locomoled_driver = {
>   	},
>   	.devid	= LOCOMO_DEVID_LED,
>   	.probe	= locomoled_probe,
> -	.remove	= locomoled_remove,
>   };
>
>   static int __init locomoled_init(void)
>

Applied, thanks.

-- 
Best Regards,
Jacek Anaszewski

      reply	other threads:[~2015-10-19  8:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16 21:33 [PATCH] leds: leds-locomo.c: Use devm_led_classdev_register Fida Mohammad
2015-10-19  8:16 ` Jacek Anaszewski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5624A6C9.8080806@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=cooloney@gmail.com \
    --cc=fmthoker@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.