Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dcf70112 authored by Mark Brown's avatar Mark Brown
Browse files

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: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 0f82b6cf
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -2941,6 +2941,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EINVAL);


	dev = config->dev;
	dev = config->dev;
	WARN_ON(!dev);


	if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
	if (regulator_desc->name == NULL || regulator_desc->ops == NULL)
		return ERR_PTR(-EINVAL);
		return ERR_PTR(-EINVAL);