[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1574074762-34629-1-git-send-email-zhengbin13@huawei.com>
Date: Mon, 18 Nov 2019 18:59:22 +0800
From: zhengbin <zhengbin13@...wei.com>
To: <lgirdwood@...il.com>, <broonie@...nel.org>, <liviu.dudau@....com>,
<sudeep.holla@....com>, <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>
CC: <zhengbin13@...wei.com>
Subject: [PATCH] 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@...wei.com>
Signed-off-by: zhengbin <zhengbin13@...wei.com>
---
drivers/regulator/vexpress-regulator.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/regulator/vexpress-regulator.c b/drivers/regulator/vexpress-regulator.c
index 1235f46..5d39663 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[] = {
--
2.7.4
Powered by blists - more mailing lists