From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMvQg-0008C2-Vq for barebox@lists.infradead.org; Mon, 28 Sep 2020 15:51:11 +0000 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kMvQf-0000Z9-QR for barebox@lists.infradead.org; Mon, 28 Sep 2020 17:51:05 +0200 Received: from mfe by dude02.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1kMvQe-0000Jm-Ki for barebox@lists.infradead.org; Mon, 28 Sep 2020 17:51:04 +0200 From: Marco Felsch Date: Mon, 28 Sep 2020 17:50:31 +0200 Message-Id: <20200928155041.32649-9-m.felsch@pengutronix.de> In-Reply-To: <20200928155041.32649-1-m.felsch@pengutronix.de> References: <20200928155041.32649-1-m.felsch@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 08/18] regulator: stpmic1: fix registering missed regulators To: barebox@lists.infradead.org The dts regulators subnode can be incomplete e.g. if the pre-programmed values are valid and shouldn't be changed. Missing regulator nodes are indicated by "of_regulator_match->of_node == NULL". Take missing regulators into account and register only existing ones. Signed-off-by: Marco Felsch --- drivers/regulator/stpmic1_regulator.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/regulator/stpmic1_regulator.c b/drivers/regulator/stpmic1_regulator.c index 71a4ae80c3..2b4b729541 100644 --- a/drivers/regulator/stpmic1_regulator.c +++ b/drivers/regulator/stpmic1_regulator.c @@ -383,6 +383,11 @@ static int stpmic1_regulator_register(struct device_d *dev, int id, { int ret; + if (!match->of_node) { + dev_dbg(dev, "Skip missing DTB regulator %s", match->name); + return 0; + } + cfg->dev = dev; cfg->rdev.desc = &cfg->desc; cfg->rdev.regmap = dev_get_regmap(dev->parent, NULL); -- 2.20.1 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox