[PATCH 3/6] usb: musb-new: Update phandle handling
Simon Glass
sjg at chromium.org
Mon Jun 1 16:58:21 CEST 2026
Hi Peng,
On 2026-05-26T09:09:56, Peng Fan (OSS) <peng.fan at oss.nxp.com> wrote:
> usb: musb-new: Update phandle handling
>
> Switch to ofnode_parse_phandle() and add proper ofnode_valid() checks when
> resolving 'phys' and 'ti,ctrl_mod' references to avoid operating on invalid
> nodes.
>
> No functional changes.
>
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
>
> drivers/usb/musb-new/ti-musb.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
> diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
> @@ -88,8 +88,14 @@ static int ti_musb_of_to_plat(struct udevice *dev)
> - phys_node = ofnode_get_by_phandle(dev_read_u32_default(dev, 'phys', 0));
> - ctrl_mod_node = ofnode_get_by_phandle(ofnode_read_u32_default(phys_node, 'ti,ctrl_mod', 0));
> + phys_node = ofnode_parse_phandle(node, 'phys', 0);
> + if (!ofnode_valid(phys_node))
> + return -EINVAL;
> +
> + ctrl_mod_node = ofnode_parse_phandle(phys_node, 'ti,ctrl_mod', 0);
> + if (!ofnode_valid(ctrl_mod_node))
> + return -EINVAL;
> +
Not quite no functional change - previously a missing or invalid phys
/ ti,ctrl_mod left ctrl_mod_base pointing at ofnode_get_addr() on an
invalid node and probe carried on; now those cases return -EINVAL and
probe fails. That is the right behaviour, but please call it out in
the commit message.
Regards,
Simon
More information about the U-Boot
mailing list