Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 281C3C433EF for ; Thu, 31 Mar 2022 03:04:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D7A784191; Thu, 31 Mar 2022 05:04:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1648695848; bh=JAw7liu7YfUsDFEm0UD7S62JsQetsnmrGRoF0auCY0Q=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=l0xYGJeb7n0M0nGaU5J9siKdSAIB5axCoO7o8UzIjTaTvuMydPIlUfsDH8zPZ4NCD azrdqvnPxnXn6PVbzjxMfOSNkBnIKHM+Ca11NhAmLSdccA9TsO8YOVLld8F3+A4cFi iM5vOpOl+rzCx6NEryMYiqIaBLyWvwOPafqGqWCdvKgA3VhJIXce4i909T0lJnHDOu MQHheNQUPkP4vpjkZdqm5j5FMYeizjrqw5n1X4attqDQnhmuMubBgTmByQApSpn6GQ Q8krNK6TyzE3dMSSXGno5Kl3E5qciS4IbyQd6yEsqON34a0vwACNXwPKji8ItbxyTa 7L0rW7dnB8g9w== Received: from tr.lan (ip-89-176-112-137.net.upcbroadband.cz [89.176.112.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 821D3840EC; Thu, 31 Mar 2022 05:04:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1648695845; bh=JAw7liu7YfUsDFEm0UD7S62JsQetsnmrGRoF0auCY0Q=; h=From:To:Cc:Subject:Date:From; b=fIqNvpjbQmTAGhsbeYbLJ+hKYs62+h6cGQHeH8lvi9bto0RZJeij9ihCOyLQn5trE p3YoroDM5OPvePIK9TOF3HT1YgID6ylZnHS/YO1PwDhRsS0pa0gZZ8RTdnSLNfGNSx Nef9KcmlyxVtWPbui5lDxu9flWv6PSqAgKJEn2PykOTTBNmE8ULYqyr1QNowRXDnZe nbOUAir5x+mxxfLPuRGnnLigVCNIJ3hti38kz5WB1FC11hXSpsB2tLji1cBPY6YF3Q dBs4xUb/sAQ2+ttpsGcpgjLc1XaueOfs4zwaP7kaenMAKppUMo4nHTnFJP1FZJ+N61 G5cwPEeaAAH8A== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Fabio Estevam , Peng Fan , Stefano Babic Subject: [PATCH 1/3] imx: power-domain: Descend into pgc subnode if present Date: Thu, 31 Mar 2022 05:03:47 +0200 Message-Id: <20220331030349.482922-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic --- drivers/power/domain/imx8m-power-domain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/power/domain/imx8m-power-domain.c b/drivers/power/domain/imx8m-power-domain.c index 6082ee6ff8c..ac7411f8327 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), -- 2.35.1