mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Jean-Jacques Hiblot <jjhiblot@ti.com>, pavel@ucw.cz, dmurphy@ti.com
Cc: tomi.valkeinen@ti.com, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] leds: tlc591xx: simplify driver by using the managed led API
Date: Thu, 19 Sep 2019 22:51:00 +0200	[thread overview]
Message-ID: <35676405-613b-d650-b7e1-4fc7d9269a35@gmail.com> (raw)
In-Reply-To: <20190918152556.9925-2-jjhiblot@ti.com>

Hi Jean,

Thank you for the updated set.

We will need one more iteration. Please refer below.

On 9/18/19 5:25 PM, Jean-Jacques Hiblot wrote:
> Use the managed API of the LED class (devm_led_classdev_register()
> instead of led_classdev_register()).
> This allows us to remove the code used to track-and-destroy the LED devices
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/leds/leds-tlc591xx.c | 79 +++++++++---------------------------
>  1 file changed, 20 insertions(+), 59 deletions(-)
> 
> diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
> index 59ff088c7d75..3d5a4b92f016 100644
> --- a/drivers/leds/leds-tlc591xx.c
> +++ b/drivers/leds/leds-tlc591xx.c
> @@ -128,51 +128,6 @@ tlc591xx_brightness_set(struct led_classdev *led_cdev,
>  	return err;
>  }
>  
[...]
> +		led->ldev.max_brightness = LED_FULL;

This is redundant since initially zeroed by kzalloc and LED core sets it
to LED_FULL in this case, so we can remove it by this occasion.

We have also one fix to this driver, preceding this patch, so your set
will need a rebase onto for-5.5 branch [0].


> +		err = devm_led_classdev_register(dev, &led->ldev);
> +		if (err < 0) {
> +			dev_err(dev, "couldn't register LED %s\n",
> +				led->ldev.name);
> +			return err;
> +		}
> +	}
>  	return 0;
>  }
>  
> @@ -268,7 +230,6 @@ static struct i2c_driver tlc591xx_driver = {
>  		.of_match_table = of_match_ptr(of_tlc591xx_leds_match),
>  	},
>  	.probe = tlc591xx_probe,
> -	.remove = tlc591xx_remove,
>  	.id_table = tlc591xx_id,
>  };
>  
> 

[0]
https://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git/log/?h=for-5.5

-- 
Best regards,
Jacek Anaszewski

  reply	other threads:[~2019-09-19 20:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 15:25 [PATCH v3 0/2] leds: tlc591xx: switch to managed LED registration Jean-Jacques Hiblot
2019-09-18 15:25 ` [PATCH v3 1/2] leds: tlc591xx: simplify driver by using the managed led API Jean-Jacques Hiblot
2019-09-19 20:51   ` Jacek Anaszewski [this message]
2019-09-26 12:13   ` Pavel Machek
2019-09-18 15:25 ` [PATCH v3 2/2] leds: tlc591xx: use devm_led_classdev_register_ext() Jean-Jacques Hiblot
2019-09-26 12:12   ` Pavel Machek

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=35676405-613b-d650-b7e1-4fc7d9269a35@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=jjhiblot@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=tomi.valkeinen@ti.com \
    /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®