From: Marek Vasut Date: Tue, 12 Apr 2022 22:42:49 +0000 (+0200) Subject: imx: power-domain: Descend into pgc subnode if present X-Git-Tag: v2022.07~90^2~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8741d9275626dc2fdea725b6c5bdcd824c03a526;p=platform%2Fkernel%2Fu-boot.git imx: power-domain: Descend into pgc subnode if present In case the power domain node structure is gpc@303a0000/pgc/power-domain@N, do not bind power domain driver to the 'pgc' node, but rather descend into it and only bind power domain drivers to power-domain@N subnodes. This way we do not waste one useless driver instance associated with 'pgc' node. Tested-By: Tim Harvey #imx8mp-venice-defconfig Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic --- diff --git a/drivers/power/domain/imx8m-power-domain.c b/drivers/power/domain/imx8m-power-domain.c index 6082ee6..ac7411f 100644 --- a/drivers/power/domain/imx8m-power-domain.c +++ b/drivers/power/domain/imx8m-power-domain.c @@ -73,6 +73,12 @@ static int imx8m_power_domain_bind(struct udevice *dev) /* Bind the subnode to this driver */ name = fdt_get_name(gd->fdt_blob, offset, NULL); + /* Descend into 'pgc' subnode */ + if (!strstr(name, "power-domain")) { + offset = fdt_first_subnode(gd->fdt_blob, offset); + name = fdt_get_name(gd->fdt_blob, offset, NULL); + } + ret = device_bind_with_driver_data(dev, dev->driver, name, dev->driver_data, offset_to_ofnode(offset),