From: Peng Fan Date: Tue, 10 Feb 2026 08:12:15 +0000 (+0800) Subject: power: domain: Validate device tree node in dev_power_domain_ctrl X-Git-Tag: v2026.04-rc4~17^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ee82240de63b085325b4f4ce4874240724f9dbe;p=thirdparty%2Fu-boot.git power: domain: Validate device tree node in dev_power_domain_ctrl Similar to pinctrl_select_state(), add dev_has_ofnode() check before doing the real work. Device(scmi_base.0) does not have a real device node, ofnode_null() is assigned as the device tree node for scmi base protocol device: 'commit 7eb4eb541c14 ("firmware: scmi: install base protocol to SCMI agent")' However with recent update in 'commit 0535e46d55d7 ("scripts/dtc: Update to upstream version v1.7.2-35-g52f07dcca47c")', SPL panic in fdt_check_node_offset_()->fdt_next_tag(), because offset is -1 and SPL_OF_LIBFDT_ASSUME_MASK is 0xFF. So need to validate device tree node. Reported-by: Ye Li Closes: https://lore.kernel.org/u-boot/939a9696-27fa-45a1-b428-feffe21ac6d5@oss.nxp.com/ Signed-off-by: Peng Fan --- diff --git a/drivers/power/domain/power-domain-uclass.c b/drivers/power/domain/power-domain-uclass.c index d9fa8ad4bd2..cea68945cbd 100644 --- a/drivers/power/domain/power-domain-uclass.c +++ b/drivers/power/domain/power-domain-uclass.c @@ -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++) {