Re: Labels removed from Device Tree


Bolivar, Marti
 

For a node:

foo: my-node... {
label = "bar";
...
};

You may use device_get_binding("bar") or
DEVICE_DT_GET(DT_NODELABEL(foo)).

The DT_NODELABEL(foo) part may be changed for an arbitrary devicetree
node identifier.

Please refer here for more details about node identifiers:

docs.zephyrproject.org/latest/build/dts/api-usage.html#node-identifiers

and here for more on DEVICE_DT_GET:

docs.zephyrproject.org/latest/kernel/drivers/index.html#group__device__model_1ga9a65996ce21f43acb7db061e23b48ec7

My apologies if my corporate email server mangles the above links.

HTH,
Martí

On Mon, Aug 01 2022, Bernd via lists zephyrproject org Weiberg wrote:
Hello,
the commit dts: arm: st: Remove label property from devicetrees
has broken my code.
I used device_get_binding() with the string to the device label in the dts file.
What is the correct approach in this case?



Join users@lists.zephyrproject.org to automatically receive all group messages.