Re: [PATCH v2 2/3] arm64: dts: rockchip: rk3399-roc-pc: Fix MMC numbering for LED triggers

Robin Murphy
2020-04-27T15:14:06Z

On 2020-04-27 3:12 pm, Johan Jonker wrote:
> Hi,
>
>>> So for fixing up the LED node names, we'd probably want the following:
>>>
>>> diy_led: led-0
>>> yellow_led: led-1
>>> work_led: led-2
>
> Change proposal for led nodes to comply with preexisting dts.
> Does this work?
>
> diy_led: led_0: led-0
> yellow_led: led_1: led-1
> work_led: led_2: led-2

Yuck, why?

Labels are simply human-readable source annotations for the sake of
referencing nodes more easily. Meaningful label names - that correlate
to SoC or board components, schematic names, or physical labels on the
board/device - make the DT sources easier to read, review, and maintain.
There are a handful of cases where one node might have multiple labels,
e.g. if two logical supply nets come from the same regulator on certain
board variants, but there is zero point in defining redundant labels
that just meaninglessly echo the DT's own structure.

> blue: led_0: led-0
>
> A check does not give any warnings.

I should hope not. Labels are there to be consumed by DT compilers (and
whatever symbolic overlay handlers count as... DT linkers, maybe?) -
they have no business being within the scope of the bindings that define
a contract for system software consuming the final DTB.

Robin.

> make -k ARCH=arm dtbs_check
> DT_SCHEMA_FILES=Documentation/devicetree/bindings/leds/leds-gpio.yaml
>
>>
>> That doesn't look pretty either.
>> Would like to hear the maintainers view on how to handle other cases
>> without 'led' like for example 'blue' for mk808.
>>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
>