Skip to content

Commit

Permalink
regulator: core: Warn on missing struct device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed May 10, 2012
1 parent 0f82b6c commit dcf7011
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dcf7011

Please sign in to comment.