[PATCH 06/18] regulator: improve of_regulator_register error handling

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

 



Don't ignore errors from __regulator_register().

Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
---
 drivers/regulator/core.c | 3 +++
 1 file changed, 3 insertions(+)

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",
-- 
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