Skip to content

Commit

Permalink
regulator: da9063: Use IS_ERR to check return value of regulator_regi…
Browse files Browse the repository at this point in the history
…ster()

regulator_register() does not return NULL, it returns ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 30, 2013
1 parent 556dcf9 commit e515800
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/regulator/da9063-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
config.of_node = da9063_reg_matches[id].of_node;
config.regmap = da9063->regmap;
regl->rdev = regulator_register(&regl->desc, &config);
if (IS_ERR_OR_NULL(regl->rdev)) {
if (IS_ERR(regl->rdev)) {
dev_err(&pdev->dev,
"Failed to register %s regulator\n",
regl->desc.name);
Expand Down

0 comments on commit e515800

Please sign in to comment.