summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown2012-05-08 19:09:12 +0200
committerMark Brown2012-05-10 11:48:37 +0200
commitdcf701125eefea6baf72753533cb8b60fb0e3934 (patch)
treeaf88fe1d27d9b9061a00a3a9064ac18d6389cb95 /drivers/regulator/core.c
parentregulator: dummy: Specify a struct device (diff)
downloadkernel-qcow2-linux-dcf701125eefea6baf72753533cb8b60fb0e3934.tar.gz
kernel-qcow2-linux-dcf701125eefea6baf72753533cb8b60fb0e3934.tar.xz
kernel-qcow2-linux-dcf701125eefea6baf72753533cb8b60fb0e3934.zip
regulator: core: Warn on missing struct device
The core really wants a struct device to be supplied for regulators and there's no reason this should be impossible so provide one so complain if we didn't get one. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9fafa00b8cd4..10fb252323fb 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2941,6 +2941,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
return ERR_PTR(-EINVAL);
dev = config->dev;
+ WARN_ON(!dev);
if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
return ERR_PTR(-EINVAL);