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, LKML <linux-kernel@vger.kernel.org>,
Muhammad Falak <falakreyaz@gmail.com>,
Kristoffer <kristoffer.ericson@gmail.com>
Subject: Re: [PATCH] leds: leds-hp6xx: Use of devm_classdev_register
Date: Tue, 27 Oct 2015 09:16:56 +0100 [thread overview]
Message-ID: <562F32F8.6050701@samsung.com> (raw)
In-Reply-To: <1445878828-32514-1-git-send-email-fmthoker@gmail.com>
Hi Fida,
Thanks for the patch. It doesn't apply smoothly, though.
Please rebase the patch on the top of LED git tree [1], for-next
branch.
[1]
git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
Best Regards,
Jacek Anaszewski
On 10/26/2015 06:00 PM, Fida Mohammad wrote:
> Use resource managed function devm_classdev_register to make
> error path simpler. Also removed the redundant remove function.
>
> Signed-off-by: Fida Mohammad <fmthoker@gmail.com>
> ---
> drivers/leds/leds-hp6xx.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/leds/leds-hp6xx.c b/drivers/leds/leds-hp6xx.c
> index 0b84c01..ffb6d5b 100644
> --- a/drivers/leds/leds-hp6xx.c
> +++ b/drivers/leds/leds-hp6xx.c
> @@ -59,28 +59,17 @@ static int hp6xxled_probe(struct platform_device *pdev)
> {
> int ret;
>
> - ret = led_classdev_register(&pdev->dev, &hp6xx_red_led);
> + ret = devm_led_classdev_register(&pdev->dev, &hp6xx_red_led);
> if (ret < 0)
> return ret;
>
> - ret = led_classdev_register(&pdev->dev, &hp6xx_green_led);
> - if (ret < 0)
> - led_classdev_unregister(&hp6xx_red_led);
> + return devm_led_classdev_register(&pdev->dev, &hp6xx_green_led);
>
> - return ret;
> }
>
> -static int hp6xxled_remove(struct platform_device *pdev)
> -{
> - led_classdev_unregister(&hp6xx_red_led);
> - led_classdev_unregister(&hp6xx_green_led);
> -
> - return 0;
> -}
>
> static struct platform_driver hp6xxled_driver = {
> .probe = hp6xxled_probe,
> - .remove = hp6xxled_remove,
> .driver = {
> .name = "hp6xx-led",
> },
>
prev parent reply other threads:[~2015-10-27 8:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 17:00 [PATCH] leds: leds-hp6xx: Use of devm_classdev_register Fida Mohammad
2015-10-27 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=562F32F8.6050701@samsung.com \
--to=j.anaszewski@samsung.com \
--cc=cooloney@gmail.com \
--cc=falakreyaz@gmail.com \
--cc=fmthoker@gmail.com \
--cc=kristoffer.ericson@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 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).