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

David Gibson <[email protected]> Wed, 21 Jan 2026 20:02:33 +1100
Newsgroups org.kernel.vger.devicetree-spec,org.kernel.vger.devicetree-compiler,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <aXCWKf_hvdPsMNKL@zatzit>
--6ESkxfyR4Qodtky1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jan 19, 2026 at 05:02:40PM +0100, Herve Codina wrote:
> On Thu, 15 Jan 2026 17:51:30 +1100
> David Gibson <[email protected]> wrote:
>=20
> > On Mon, Jan 12, 2026 at 03:19:36PM +0100, Herve Codina wrote:
> > > The future introduction of orphan nodes for addons device-tree will l=
ead
> > > 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
> > >=20
> > > 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.
> > >=20
> > > To prepare this change, introduce and use dti_get_marker_label().
> > >=20
> > > 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.
> > >=20
> > > 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.
> > >=20
> > > This introduction doesn't lead to any functional changes. =20
> >=20
> > For all of these functions, if the new one is basically replacing the
> > old one, don't change the name, just change the signature.
>=20
> 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 cal=
ls
> 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_()).

--=20
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

--6ESkxfyR4Qodtky1
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmlwlh0ACgkQzQJF27ox
2GfVXQ//RtZrNUfiUzLMX6Ez9zIWtNtlRvi7GzcRRvtDilwRUtAx1uAjh1Z5Jjem
WBkpPUZxlwOE/UBYISPDL4vy2zTddChVb9Dvg3GBHed0rwiYwgsn9jjB+Ne6rfjv
ozEQd+DmMNzx83Pb6BQAJsX9Twy6oBYxysdackblfRlJ4oNEreGRhzXaNhqTks7A
Tu172rK9+gANZ+xDTQgE1ulSSAAm1lPWfn0uxWLdv9PkZvhg7puKwlEld4VseZb5
bn5TmG1B4KNawyzb9lOHtG/vhuRWqy2RQnL6WB+n/QBMhNofTQpCgDSzao1h1Kcu
ybM/yRSHS5QezXcIJ9NelQJclY0IxNPHOjdzmC+AzOMFi+lf1BDIOHOUFZxLU76R
p1AzmPFjrc96MO3zrMg5w8m5iodDV/AZzPxAaCvDsiSEoWQ5GhUoHZVmIlBUT0e6
pLlMQ/lkYcYnHM0TWIVp1f54Okm2mnbhkRSHOBJnvsKmpVasczv1U5Ix1suudflS
qzWvoYl9iBkM0GejbjAjgu77R7nob6hVeSdcbkvCsjJg0fbCGoEAKrzLDUxHcJg0
n9OJ26Zkyw97EP+O7Wp85nZ0qUWHqwpnTLJr6GgylNYbDQvwoI2eFoka8i2wVgvw
gQQpb8k2EbfWfzpsoYrL+g/PgkE5mmygi7kR0cD8rOMI+zWYQqg=
=EXxc
-----END PGP SIGNATURE-----

--6ESkxfyR4Qodtky1--