mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>, <linux-leds@vger.kernel.org>
Cc: <pavel@ucw.cz>
Subject: Re: [PATCH -next] leds: wm831x-status: use devm_led_classdev_register()
Date: Sat, 5 Jun 2021 15:07:21 +0800	[thread overview]
Message-ID: <618a6c19-196f-79e7-cfc0-48551942bf53@huawei.com> (raw)
In-Reply-To: <20210605032212.698200-1-yangyingliang@huawei.com>

This patch is wrong, ignore it.

On 2021/6/5 11:22, Yang Yingliang wrote:
> Use devm_led_classdev_register() for led device registration and
> get rid of .remove callback to remove led device. This is done by
> managed device framework.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>   drivers/leds/leds-wm831x-status.c | 12 +-----------
>   1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/leds/leds-wm831x-status.c b/drivers/leds/leds-wm831x-status.c
> index c48b80574f02..8ccd8b472572 100644
> --- a/drivers/leds/leds-wm831x-status.c
> +++ b/drivers/leds/leds-wm831x-status.c
> @@ -269,7 +269,7 @@ static int wm831x_status_probe(struct platform_device *pdev)
>   	drvdata->cdev.blink_set = wm831x_status_blink_set;
>   	drvdata->cdev.groups = wm831x_status_groups;
>   
> -	ret = led_classdev_register(wm831x->dev, &drvdata->cdev);
> +	ret = devm_led_classdev_register(wm831x->dev, &drvdata->cdev);
>   	if (ret < 0) {
>   		dev_err(&pdev->dev, "Failed to register LED: %d\n", ret);
>   		return ret;
> @@ -280,21 +280,11 @@ static int wm831x_status_probe(struct platform_device *pdev)
>   	return 0;
>   }
>   
> -static int wm831x_status_remove(struct platform_device *pdev)
> -{
> -	struct wm831x_status *drvdata = platform_get_drvdata(pdev);
> -
> -	led_classdev_unregister(&drvdata->cdev);
> -
> -	return 0;
> -}
> -
>   static struct platform_driver wm831x_status_driver = {
>   	.driver = {
>   		   .name = "wm831x-status",
>   		   },
>   	.probe = wm831x_status_probe,
> -	.remove = wm831x_status_remove,
>   };
>   
>   module_platform_driver(wm831x_status_driver);

      reply	other threads:[~2021-06-05  7:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05  3:22 Yang Yingliang
2021-06-05  7:07 ` Yang Yingliang [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=618a6c19-196f-79e7-cfc0-48551942bf53@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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

all inboxes | Powered by JetHome®