From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markus Elfring Date: Sat, 07 Sep 2019 11:23:08 +0000 Subject: [PATCH] regulator: vexpress: Use PTR_ERR_OR_ZERO() in vexpress_regulator_probe() Message-Id: <1123a2ab-48f9-f41f-cabb-9b45310cb77e@web.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org, Liam Girdwood , Liviu Dudau , Lorenzo Pieralisi , Mark Brown , Sudeep Holla Cc: kernel-janitors@vger.kernel.org, LKML From: Markus Elfring Date: Sat, 7 Sep 2019 13:07:22 +0200 Simplify this function implementation by using a known function. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Markus Elfring --- 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 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[] = { -- 2.23.0