Skip to contentSkip to conversation

regulator: check for init_data on registration

PATCH In review Liam Girdwood 1 participant 1 message Sep 19, 2008 Voltage and current regulator framework

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 regulator: check for init_data on registration

Since it is now mandatory to supply constraints via init_data on device registration check for that when registering, saving us from oopsing later on.

---
 drivers/regulator/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/regulator/core.c +3 -0
index cec9c73..f5fcdf7 100644
@@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct device *dev,
 	    !regulator_desc->type == REGULATOR_CURRENT)
 		return ERR_PTR(-EINVAL);
 
+	if (!init_data)
+		return ERR_PTR(-EINVAL);
+
 	rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
 	if (rdev == NULL)
 		return ERR_PTR(-ENOMEM);
Signature · 1 line
1.5.4.3