diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-09-09 16:21:18 +0100 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2008-10-13 21:51:51 +0100 |
commit | 46fabe1edd44a8893d88d7982f88d01ccf77f0bb (patch) | |
tree | 6c01ae79e6ec7d84b839464015919cca658a5734 /drivers/regulator/core.c | |
parent | 3de89609a82aa68f543cba263eb28725e0fde511 (diff) | |
download | kernel_samsung_espresso10-46fabe1edd44a8893d88d7982f88d01ccf77f0bb.zip kernel_samsung_espresso10-46fabe1edd44a8893d88d7982f88d01ccf77f0bb.tar.gz kernel_samsung_espresso10-46fabe1edd44a8893d88d7982f88d01ccf77f0bb.tar.bz2 |
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>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 84202ea..65e07b9 100644 --- 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); |