lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 19 Sep 2019 22:51:00 +0200
From:   Jacek Anaszewski <jacek.anaszewski@...il.com>
To:     Jean-Jacques Hiblot <jjhiblot@...com>, pavel@....cz, dmurphy@...com
Cc:     tomi.valkeinen@...com, linux-leds@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] leds: tlc591xx: simplify driver by using the
 managed led API

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@...com>
> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@...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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ