For SCMI, Power Domain and IOMMU, validate device tree node before
continuing, to avoid boot failure.
This commit is contained in:
Tom Rini
2026-02-26 08:49:15 -06:00
4 changed files with 9 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ static int scmi_mbox_get_channel(struct udevice *dev,
struct scmi_mbox_channel *chan;
int ret;
if (!dev_read_prop(protocol, "shmem", NULL)) {
if (!dev_has_ofnode(protocol) || !dev_read_prop(protocol, "shmem", NULL)) {
/* Uses agent base channel */
*channel = container_of(base_chan, struct scmi_channel, ref);

View File

@@ -331,7 +331,8 @@ static int scmi_optee_get_channel(struct udevice *dev,
u32 channel_id;
int ret;
if (dev_read_u32(protocol, "linaro,optee-channel-id", &channel_id)) {
if (!dev_has_ofnode(protocol) ||
dev_read_u32(protocol, "linaro,optee-channel-id", &channel_id)) {
/* Uses agent base channel */
*channel = container_of(base_chan, struct scmi_channel, ref);

View File

@@ -79,6 +79,9 @@ int dev_iommu_enable(struct udevice *dev)
const struct iommu_ops *ops;
int i, count, ret = 0;
if (!dev_has_ofnode(dev))
return 0;
count = dev_count_phandle_with_args(dev, "iommus",
"#iommu-cells", 0);
for (i = 0; i < count; i++) {

View File

@@ -180,6 +180,9 @@ static int dev_power_domain_ctrl(struct udevice *dev, bool on)
struct power_domain pd;
int i, count, ret = 0;
if (!dev_has_ofnode(dev))
return 0;
count = dev_count_phandle_with_args(dev, "power-domains",
"#power-domain-cells", 0);
for (i = 0; i < count; i++) {