Commit 46fabe1e authored by Mark Brown's avatar Mark Brown Committed by Liam Girdwood

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.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 3de89609
...@@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, ...@@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
!regulator_desc->type == REGULATOR_CURRENT) !regulator_desc->type == REGULATOR_CURRENT)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
if (!init_data)
return ERR_PTR(-EINVAL);
rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL); rdev = kzalloc(sizeof(struct regulator_dev), GFP_KERNEL);
if (rdev == NULL) if (rdev == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment