summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorzhengbin <zhengbin13@huawei.com>2019-11-18 18:59:22 +0800
committerMark Brown <broonie@kernel.org>2019-11-18 12:58:24 +0000
commit1d7c4c115f7a835fec387d7f61767781381db5db (patch)
tree0ddff6c42e3d23c63d0d815f7ff65b033a1fc90e /drivers/regulator
parenta4bb429811bd4a5be94873ae218062c83c476ed9 (diff)
downloadlinux-1d7c4c115f7a835fec387d7f61767781381db5db.tar.gz
linux-1d7c4c115f7a835fec387d7f61767781381db5db.tar.bz2
linux-1d7c4c115f7a835fec387d7f61767781381db5db.zip
regulator: vexpress: Use PTR_ERR_OR_ZERO() to simplify code
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/vexpress-regulator.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/regulator/vexpress-regulator.c b/drivers/regulator/vexpress-regulator.c
index 1235f46e633e..5d39663efcaa 100644
--- a/drivers/regulator/vexpress-regulator.c
+++ b/drivers/regulator/vexpress-regulator.c
@@ -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[] = {