mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
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: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
This commit is contained in:
parent
3de89609a8
commit
46fabe1edd
1 changed files with 3 additions and 0 deletions
|
@ -1691,6 +1691,9 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
|
|||
!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);
|
||||
|
|
Loading…
Reference in a new issue