summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMarco Felsch <m.felsch@pengutronix.de>2020-09-28 17:50:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-09-29 10:27:21 +0200
commit9018226a218952ec752d740bdd92a6a93c169b0f (patch)
tree17569522b81c4b34073d44d7314c267a4851809c /drivers/regulator
parentc9fb9c13b6c7a67cecf557b9c66af735da2acb35 (diff)
downloadbarebox-9018226a218952ec752d740bdd92a6a93c169b0f.tar.gz
barebox-9018226a218952ec752d740bdd92a6a93c169b0f.tar.xz
regulator: improve of_regulator_register error handling
Don't ignore errors from __regulator_register(). Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 74e00d7791..a767e383fb 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -168,6 +168,9 @@ int of_regulator_register(struct regulator_dev *rd, struct device_node *node)
name = of_get_property(node, "regulator-name", NULL);
ri = __regulator_register(rd, name);
+ if (IS_ERR(ri))
+ return PTR_ERR(ri);
+
ri->node = node;
of_property_read_u32(node, "regulator-enable-ramp-delay",