diff mbox series

[-next,v2] bus: ti-sysc: Use PTR_ERR_OR_ZERO() to simplify code

Message ID 1574073452-23722-1-git-send-email-zhengbin13@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next,v2] bus: ti-sysc: Use PTR_ERR_OR_ZERO() to simplify code | expand

Commit Message

Zheng Bin Nov. 18, 2019, 10:37 a.m. UTC
Fixes coccicheck warning:

drivers/bus/ti-sysc.c:506:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
v1->v2: remove empty line, sorry for the previous noise
 drivers/bus/ti-sysc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

--
2.7.4

Comments

Tony Lindgren Dec. 12, 2019, 5:07 p.m. UTC | #1
* zhengbin <zhengbin13@huawei.com> [191118 02:31]:
> Fixes coccicheck warning:
> 
> drivers/bus/ti-sysc.c:506:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Yeah OK so this removes few lines so applying into
omap-for-v5.6/ti-sysc thanks.

Tony
diff mbox series

Patch

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 56887c6..aa55275 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -503,10 +503,8 @@  static int sysc_init_resets(struct sysc *ddata)
 {
 	ddata->rsts =
 		devm_reset_control_get_optional_shared(ddata->dev, "rstctrl");
-	if (IS_ERR(ddata->rsts))
-		return PTR_ERR(ddata->rsts);

-	return 0;
+	return PTR_ERR_OR_ZERO(ddata->rsts);
 }

 /**