Skip to content

Commit

Permalink
regulator: vexpress: Use PTR_ERR_OR_ZERO() to simplify code
Browse files Browse the repository at this point in the history
Fixes coccicheck warning:

drivers/regulator/vexpress-regulator.c:78:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Link: https://lore.kernel.org/r/1574074762-34629-1-git-send-email-zhengbin13@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
zhengbin authored and Mark Brown committed Nov 18, 2019
1 parent a4bb429 commit 1d7c4c1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/regulator/vexpress-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ static int vexpress_regulator_probe(struct platform_device *pdev)
config.of_node = pdev->dev.of_node;

rdev = devm_regulator_register(&pdev->dev, desc, &config);
if (IS_ERR(rdev))
return PTR_ERR(rdev);

return 0;
return PTR_ERR_OR_ZERO(rdev);
}

static const struct of_device_id vexpress_regulator_of_match[] = {
Expand Down

0 comments on commit 1d7c4c1

Please sign in to comment.