U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
To: Marek Vasut <marex@denx.de>, u-boot@lists.denx.de
Cc: Philippe Reynes <philippe.reynes@softathome.com>,
	Doug Zobel <douglas.zobel@climate.com>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 1/6] led-uclass: do not create fallback label for top-level node
Date: Mon, 23 Oct 2023 10:28:36 +0200	[thread overview]
Message-ID: <ec461be8-afaf-4ecd-842c-faeea8a6935c@prevas.dk> (raw)
In-Reply-To: <6d33180d-f611-43f8-9b73-9ec44eafd277@denx.de>

On 19/10/2023 15.51, Marek Vasut wrote:
> On 10/19/23 11:58, Rasmus Villemoes wrote:
>> Many existing drivers, and led-uclass itself, rely on uc_plat->label
>> being NULL for the device representing the top node, as opposed to the
>> child nodes representing individual LEDs. This means that the drivers
>> whose .probe methods rely on this were broken by 83c63f0d1185 ("led:
>> Move OF "label" property parsing to core"), and also that the top node
>> wrongly shows up with 'led list'. Some drivers have since been fixed
>> up individually, e.g.
>>
>> e3aa76644c2a "led: gpio: Check device compatible string to determine
>> the top level node"
>> 01074697801b "led: gpio: Use NOP uclass driver for top-level node"
>> 910b01c27c04 "drivers: led: bcm6753: do not use null label to find the
>> top"
>>
>> Binding the same driver to the top node as to the individual child
>> nodes is arguably wrong, and the approach of using a UCLASS_NOP driver
>> for the top node is probably better.
> 
> Note that
> 83c63f0d1185 ("led: Move OF "label" property parsing to core")
> and
> 01074697801b ("led: gpio: Use NOP uclass driver for top-level node")
> were applied shortly after each other, so I don't see the point of the
> aforementioned rant.

What rant? I'm merely trying to write down what I found out while trying
to figure out why 83c63f0d1185 broke stuff, while acknowledging that the
fixes that have been applied to some drivers are probably the approach
in general.

> I sort-of understand what you are trying to do in this patch based on
> $SUBJECT of this email, but not from this wall of text, so can you
> abbreviate the commit message ?

Sure, I can try and make it shorter.

>> -    if (!uc_plat->label)
>> +    if (!uc_plat->label && !dev_read_string(dev, "compatible"))
>>           uc_plat->label = ofnode_get_name(dev_ofnode(dev));
> 
> Is there an existing driver which has a top-level DT node with "label"
> property ?

-ENOPARSE? A driver doesn't have a top-level DT node.

And regardless, this wouldn't change anything for a top-level DT node
with a "label" property, as we're still unconditionally first trying to
read a "label" property, this is merely avoiding adding a fallback value
for top-level DT nodes (using "having a "compatible" DT property as
proxy for that "is a top-level DT node"). So I really don't understand
what you are trying to ask.

Rasmus


  reply	other threads:[~2023-10-23  8:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19  9:58 [PATCH 0/6] some LED patches Rasmus Villemoes
2023-10-19  9:58 ` [PATCH 1/6] led-uclass: do not create fallback label for top-level node Rasmus Villemoes
2023-10-19 13:51   ` Marek Vasut
2023-10-23  8:28     ` Rasmus Villemoes [this message]
2023-10-23  9:01       ` Marek Vasut
2023-10-19  9:58 ` [PATCH 2/6] led-uclass: honour ->label field populated by driver's own .bind Rasmus Villemoes
2023-10-19 13:54   ` Marek Vasut
2023-10-23  8:51     ` Rasmus Villemoes
2023-10-23  9:03       ` Marek Vasut
2023-11-14 12:11         ` Christian Gmeiner
2023-11-15  5:37           ` Marek Vasut
2023-11-16  9:21             ` Pavel Machek
2023-10-23 10:43       ` Christian Gmeiner
2023-10-19  9:58 ` [PATCH 3/6] led: introduce led_bind_generic() Rasmus Villemoes
2023-10-19 13:56   ` Marek Vasut
2023-10-19  9:58 ` [PATCH 4/6] led: led_gpio: use led_bind_generic() helper Rasmus Villemoes
2023-10-19 13:56   ` Marek Vasut
2023-10-19  9:58 ` [PATCH 5/6] led: led_pwm: " Rasmus Villemoes
2023-10-19 13:57   ` Marek Vasut
2023-10-19  9:58 ` [PATCH 6/6] led: add TI LP5562 LED driver Rasmus Villemoes
2023-10-19 13:58   ` Marek Vasut
2023-10-23  9:11     ` Rasmus Villemoes
2023-10-23  9:39       ` Marek Vasut
2023-10-23 11:17         ` Rasmus Villemoes

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=ec461be8-afaf-4ecd-842c-faeea8a6935c@prevas.dk \
    --to=rasmus.villemoes@prevas.dk \
    --cc=douglas.zobel@climate.com \
    --cc=marex@denx.de \
    --cc=philippe.reynes@softathome.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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