diff mbox series

[v2,16/29] memory: renesas-rpc-if: Simplify with PTR_ERR_OR_ZERO

Message ID 20200724074038.5597-17-krzk@kernel.org (mailing list archive)
State New, archived
Headers show
Series *memory: Cleanup, improve and compile test memory drivers | expand

Commit Message

Krzysztof Kozlowski July 24, 2020, 7:40 a.m. UTC
Use PTR_ERR_OR_ZERO to make the code a little bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/memory/renesas-rpc-if.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Krzysztof Kozlowski Aug. 17, 2020, 6:34 p.m. UTC | #1
On Fri, Jul 24, 2020 at 09:40:25AM +0200, Krzysztof Kozlowski wrote:
> Use PTR_ERR_OR_ZERO to make the code a little bit simpler.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/memory/renesas-rpc-if.c | 4 +---

Applied.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 88f51ec8f1d1..f2a33a1af836 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -199,10 +199,8 @@  int rpcif_sw_init(struct rpcif *rpc, struct device *dev)
 		rpc->dirmap = NULL;
 
 	rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
-	if (IS_ERR(rpc->rstc))
-		return PTR_ERR(rpc->rstc);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(rpc->rstc);
 }
 EXPORT_SYMBOL(rpcif_sw_init);