All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jacek Anaszewski <j.anaszewski@samsung.com>
To: Evan McClain <aeroevan@gmail.com>
Cc: linux-leds@vger.kernel.org, Simon Que <sque@chromium.org>
Subject: Re: [PATCH] leds: chromeos: Use devm_led_classdev_register.
Date: Mon, 22 Feb 2016 09:04:47 +0100	[thread overview]
Message-ID: <56CAC11F.1040302@samsung.com> (raw)
In-Reply-To: <1456081624-14058-1-git-send-email-aeroevan@gmail.com>

Hi Evan, Simon,

Please merge these changes with the patch v3 [1] - I've been
waiting for this update and hasn't applied v3 yet.

[1] http://www.spinics.net/lists/linux-leds/msg05353.html

On 02/21/2016 08:07 PM, Evan McClain wrote:
> Also use managed devm_kzalloc.
>
> Signed-off-by: Evan McClain <aeroevan@gmail.com>
> ---
>   drivers/leds/leds-chromeos-keyboard.c | 10 +++-------
>   1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/leds/leds-chromeos-keyboard.c b/drivers/leds/leds-chromeos-keyboard.c
> index 6a6ff75..4e56ede 100644
> --- a/drivers/leds/leds-chromeos-keyboard.c
> +++ b/drivers/leds/leds-chromeos-keyboard.c
> @@ -69,7 +69,7 @@ static int keyboard_led_probe(struct platform_device *pdev)
>   		return -ENODEV;
>   	}
>
> -	cdev = kzalloc(sizeof(struct led_classdev), GFP_KERNEL);
> +	cdev = devm_kzalloc(&pdev->dev, sizeof(struct led_classdev), GFP_KERNEL);
>   	if (!cdev)
>   		return -ENOMEM;
>   	cdev->name = "chromeos::kbd_backlight";
> @@ -78,15 +78,12 @@ static int keyboard_led_probe(struct platform_device *pdev)
>   	cdev->brightness = cdev->max_brightness;
>   	cdev->flags |= LED_CORE_SUSPENDRESUME;
>
> -	ret = led_classdev_register(&pdev->dev, cdev);
> +	ret = devm_led_classdev_register(&pdev->dev, cdev);
>   	if (ret)
> -		goto err;
> +		return ret;
>
>   	platform_set_drvdata(pdev, cdev);
>   	return 0;
> -err:
> -	kfree(cdev);
> -	return ret;
>   }
>
>   static int keyboard_led_remove(struct platform_device *pdev)
> @@ -94,7 +91,6 @@ static int keyboard_led_remove(struct platform_device *pdev)
>   	struct led_classdev *cdev = platform_get_drvdata(pdev);
>
>   	platform_set_drvdata(pdev, NULL);
> -	kfree(cdev);
>   	return 0;
>   }
>
>


-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2016-02-22  8:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-12 19:11 [PATCH v3] leds: Add Chrome OS keyboard LEDs driver Simon Que
2016-01-14  2:23 ` [PATCH 2/2] leds: leds-chromeos-keyboard: Add ACPI _HID probing Evan McClain
2016-02-21 19:07   ` [PATCH] leds: chromeos: Use devm_led_classdev_register Evan McClain
2016-02-22  8:04     ` Jacek Anaszewski [this message]
2016-01-21 10:23 ` [PATCH v3] leds: Add Chrome OS keyboard LEDs driver Jacek Anaszewski

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=56CAC11F.1040302@samsung.com \
    --to=j.anaszewski@samsung.com \
    --cc=aeroevan@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=sque@chromium.org \
    /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.