Re: [PATCH v4 26/26] leds: an30259a: Use generic support for composing LED names

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 2019-04-17 22:54:39, Jacek Anaszewski wrote:
> Switch to using generic LED support for composing LED class
> device name.
> 
> Signed-off-by: Jacek Anaszewski <jacek.anaszewski@xxxxxxxxx>
> Cc: Simon Shields <simon@xxxxxxxxxxxxx>

> @@ -312,13 +306,20 @@ static int an30259a_probe(struct i2c_client *client)
>  	chip->regmap = devm_regmap_init_i2c(client, &an30259a_regmap_config);
>  
>  	for (i = 0; i < chip->num_leds; i++) {
> +		struct led_init_data init_data;
> +
>  		an30259a_init_default_state(&chip->leds[i]);
>  		chip->leds[i].cdev.brightness_set_blocking =
>  			an30259a_brightness_set;
>  		chip->leds[i].cdev.blink_set = an30259a_blink_set;
>  
> -		err = devm_led_classdev_register(&client->dev,
> -						 &chip->leds[i].cdev);
> +		init_data.fwnode = chip->leds[i].fwnode;
> +		init_data.devicename = AN30259A_NAME;
> +		init_data.default_label = ":";
> +
> +		err = devm_led_classdev_register_ext(&client->dev,
> +						 &chip->leds[i].cdev,
> +						 &init_data);
>  		if (err < 0)
>  			goto exit;
>  	}

Again, uninitialized field in init_data... AFAICT.

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux