From: Mark Brown Date: Tue, 8 May 2012 17:09:12 +0000 (+0100) Subject: regulator: core: Warn on missing struct device X-Git-Tag: firefly_0821_release~3680^2~2855^2~58^3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dcf701125eefea6baf72753533cb8b60fb0e3934;p=firefly-linux-kernel-4.4.55.git 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 Acked-by: Liam Girdwood --- 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);