Re: [PATCH v5] backlight: led-backlight: add devlink to supplier LEDs

From: Luca Ceresoli
Date: Mon May 19 2025 - 16:15:16 EST


Hi Hervé,

On Mon, 19 May 2025 17:47:29 +0200
Herve Codina <herve.codina@xxxxxxxxxxx> wrote:

> Hi Luca,
>
> On Mon, 19 May 2025 17:16:39 +0200
> Luca Ceresoli <luca.ceresoli@xxxxxxxxxxx> wrote:
>
> ...
>
> > diff --git a/drivers/video/backlight/led_bl.c b/drivers/video/backlight/led_bl.c
> > index d2db157b2c290adc3a159023e9e2394fc877388c..8fe645b5b75447d009e1045dcf0c62d3bbc5425e 100644
> > --- a/drivers/video/backlight/led_bl.c
> > +++ b/drivers/video/backlight/led_bl.c
> > @@ -209,6 +209,19 @@ static int led_bl_probe(struct platform_device *pdev)
> > return PTR_ERR(priv->bl_dev);
> > }
> >
> > + for (i = 0; i < priv->nb_leds; i++) {
> > + struct device_link *link;
> > +
> > + link = device_link_add(&pdev->dev, priv->leds[0]->dev->parent,
>
> It should be priv->leds[i]->dev->parent instead of leds[0], shouldn't it?

Ah, well spotted, thanks!

My led-backlight device only uses one LED, so I hadn't noticed during
testing.

v6 on its way.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com