Thread (160 messages) 160 messages, 4 authors, 2026-01-29

Re: [RFC PATCH 46/77] dtc: Introduce dti_get_marker_label()

From: David Gibson <hidden>
Date: 2026-01-21 09:02:52
Also in: lkml

On Mon, Jan 19, 2026 at 05:02:40PM +0100, Herve Codina wrote:
On Thu, 15 Jan 2026 17:51:30 +1100
David Gibson [off-list ref] wrote:
quoted
On Mon, Jan 12, 2026 at 03:19:36PM +0100, Herve Codina wrote:
quoted
The future introduction of orphan nodes for addons device-tree will lead
to more than one tree in the addons data. Those trees will be:
  - the classical root tree starting at the root node
  - trees related to orphan nodes

Also, an addon device-tree can have only trees based on orphan nodes. In
other words an addon device-tree is valid without having the classical
'root' tree.

To prepare this change, introduce and use dti_get_marker_label().

dti_get_marker_label() retrieves a marker and its related node and
property based on the label value. It behaves in the same way as
get_marker_label() but it works at the struct dt_info level.

It handles the case where a 'root' device-tree is not present and will
handle orphan nodes trees as soon as they will be introduced.

This introduction doesn't lead to any functional changes.  
For all of these functions, if the new one is basically replacing the
old one, don't change the name, just change the signature.
The old function is kept an used internally (move to static).
It is not a simple replacement.
It's a replacement in the sense that all the existing callers are
moving to the new function.
When I introduce orphan node later on, those dti_xxxx() functions call
the old function multiple times. One call for the root tree and other calls
for orphan trees.
But anyway, If you prefer keeping the old name with a new signature,
I can do the following:
 - move function_name() to __function_name()
 - Update the function_name() signature and call __function_name().
That's a better plan.  Except don't use __function_name().  _ prefixed
names are reserved for the C library.  Use a _ suffix instead
(e.g. see fdt_get_property_by_offset_()).

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help