[-next] bus: ti-sysc: Use PTR_ERR_OR_ZERO() to simplify code
diff mbox series

Message ID 1574073227-21645-1-git-send-email-zhengbin13@huawei.com
State New
Headers show
Series
  • [-next] bus: ti-sysc: Use PTR_ERR_OR_ZERO() to simplify code
Related show

Commit Message

Zheng Bin Nov. 18, 2019, 10:33 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>
---
 drivers/bus/ti-sysc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--
2.7.4

Patch
diff mbox series

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 56887c6..5411858 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -503,10 +503,9 @@  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);
+
 }

 /**