[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <5624A6C9.8080806@samsung.com>
Date: Mon, 19 Oct 2015 10:16:09 +0200
From: Jacek Anaszewski <j.anaszewski@...sung.com>
To: Fida Mohammad <fmthoker@...il.com>
Cc: Bryan Wu <cooloney@...il.com>, Richard Purdie <rpurdie@...ys.net>,
linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] leds: leds-locomo.c: Use devm_led_classdev_register
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@...il.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists