Re: [PATCH -next] bus: ti-sysc: Use PTR_ERR_OR_ZERO in sysc_init_resets()

2019-04-12 Thread Tony Lindgren
* YueHaibing  [190411 02:36]:
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Thanks but I'll rather skip this one as I find it a bit hard
to read unless there's some reasoning other than compress
few lines out of the code.

Regards,

TOny


[PATCH -next] bus: ti-sysc: Use PTR_ERR_OR_ZERO in sysc_init_resets()

2019-04-10 Thread YueHaibing
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Signed-off-by: YueHaibing 
---
 drivers/bus/ti-sysc.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index b696f26a3894..2b93be2882f3 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -432,10 +432,7 @@ static int sysc_init_resets(struct sysc *ddata)
 {
ddata->rsts =
devm_reset_control_array_get_optional_exclusive(ddata->dev);
-   if (IS_ERR(ddata->rsts))
-   return PTR_ERR(ddata->rsts);
-
-   return 0;
+   return PTR_ERR_OR_ZERO(ddata->rsts);
 }
 
 /**