projects
/
platform
/
kernel
/
linux-3.10.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3de8960
)
regulator: check for init_data on registration
author
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Tue, 9 Sep 2008 15:21:18 +0000
(16:21 +0100)
committer
Liam Girdwood
<lrg@slimlogic.co.uk>
Mon, 13 Oct 2008 20:51:51 +0000
(21:51 +0100)
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>
drivers/regulator/core.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/core.c
b/drivers/regulator/core.c
index
84202ea
..
65e07b9
100644
(file)
--- a/
drivers/regulator/core.c
+++ b/
drivers/regulator/core.c
@@
-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);