[PATCH 08/18] regulator: stpmic1: fix registering missed regulators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <m.felsch@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux