mbox series

[v2,0/5] leds: KUnit registration tests pertaining to init_data

Message ID 20250515082830.800798-1-lee@kernel.org
Headers show
Series leds: KUnit registration tests pertaining to init_data | expand

Message

Lee Jones May 15, 2025, 8:27 a.m. UTC
Lots of drivers still register with the LED Class using init_data. Let's
provide some additional Kunit infrastructure to exercise the various
possibilities.

Change log:

v1 => v2:
 - Use devm_* to ensure resources are cleaned-up on exit

Lee Jones (5):
  leds: led-test: Move common LED class registration code into helper
    function
  leds: led-test: Provide test for registration with missing
    default_label
  leds: led-test: Provide test for registration with missing devicename
  leds: led-test: Provide test for registration with a name that is too
    long
  leds: led-test: Provide test for successful registration using
    init_data

 drivers/leds/led-test.c | 86 ++++++++++++++++++++++++++++++++++++++---
 1 file changed, 80 insertions(+), 6 deletions(-)

Comments

Jacek Anaszewski May 18, 2025, 3:32 p.m. UTC | #1
Hi Lee,

On 5/15/25 10:27, Lee Jones wrote:
> Lots of drivers still register with the LED Class using init_data. Let's

What do you mean by "still"? Actually init_data is the new approach,
that turns the LED core DT parser on, and is predestined for use with
{devm_}led_classdev_register_ext() API.

> provide some additional Kunit infrastructure to exercise the various
> possibilities.
> 
> Change log:
> 
> v1 => v2:
>   - Use devm_* to ensure resources are cleaned-up on exit
> 
> Lee Jones (5):
>    leds: led-test: Move common LED class registration code into helper
>      function
>    leds: led-test: Provide test for registration with missing
>      default_label
>    leds: led-test: Provide test for registration with missing devicename
>    leds: led-test: Provide test for registration with a name that is too
>      long
>    leds: led-test: Provide test for successful registration using
>      init_data
> 
>   drivers/leds/led-test.c | 86 ++++++++++++++++++++++++++++++++++++++---
>   1 file changed, 80 insertions(+), 6 deletions(-)
>
Lee Jones May 19, 2025, 1:33 p.m. UTC | #2
On Sun, 18 May 2025, Jacek Anaszewski wrote:

> Hi Lee,
> 
> On 5/15/25 10:27, Lee Jones wrote:
> > Lots of drivers still register with the LED Class using init_data. Let's
> 
> What do you mean by "still"? Actually init_data is the new approach,
> that turns the LED core DT parser on, and is predestined for use with
> {devm_}led_classdev_register_ext() API.

Thanks for the information.  I'll update the wording.
Jacek Anaszewski May 21, 2025, 9:26 p.m. UTC | #3
On 5/19/25 15:33, Lee Jones wrote:
> On Sun, 18 May 2025, Jacek Anaszewski wrote:
> 
>> Hi Lee,
>>
>> On 5/15/25 10:27, Lee Jones wrote:
>>> Lots of drivers still register with the LED Class using init_data. Let's
>>
>> What do you mean by "still"? Actually init_data is the new approach,
>> that turns the LED core DT parser on, and is predestined for use with
>> {devm_}led_classdev_register_ext() API.
> 
> Thanks for the information.  I'll update the wording.

Other than that, for the whole series:

Reviewed-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>