diff --git a/drivers/firmware/scmi/scmi_agent-uclass.c b/drivers/firmware/scmi/scmi_agent-uclass.c index 8f48de30c8..9a32678617 100644 --- a/drivers/firmware/scmi/scmi_agent-uclass.c +++ b/drivers/firmware/scmi/scmi_agent-uclass.c @@ -60,6 +60,7 @@ static int scmi_bind_protocols(struct udevice *dev) { int ret = 0; ofnode node; + const char *name; dev_for_each_subnode(node, dev) { struct driver *drv = NULL; @@ -71,6 +72,7 @@ static int scmi_bind_protocols(struct udevice *dev) if (ofnode_read_u32(node, "reg", &protocol_id)) continue; + name = ofnode_get_name(node); switch (protocol_id) { case SCMI_PROTOCOL_ID_CLOCK: if (IS_ENABLED(CONFIG_CLK_SCMI)) @@ -100,8 +102,7 @@ static int scmi_bind_protocols(struct udevice *dev) continue; } - ret = device_bind(dev, drv, ofnode_get_name(node), NULL, node, - NULL); + ret = device_bind(dev, drv, name, NULL, node, NULL); if (ret) break; }