blob: f6f67c9152a3b23513a69922e7c51b144656dbf0 [file] [log] [blame]
From e099190654238c33c7657f858a5ca8dd3daa6398 Mon Sep 17 00:00:00 2001
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: Thu, 2 Nov 2017 13:47:31 +0100
Subject: [PATCH 0422/1795] i2c: sh_mobile: shorten exit of xfer routine
We can use the ternary operator for easier reading.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit a4d16493be406273320f152814c33ccdb17dcf91)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/i2c/busses/i2c-sh_mobile.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 72c9483db769..ebd146ccb244 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -746,9 +746,7 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
clk_disable_unprepare(pd->clk);
pm_runtime_put_sync(pd->dev);
- if (!err)
- err = num;
- return err;
+ return err ?: num;
}
static u32 sh_mobile_i2c_func(struct i2c_adapter *adapter)
--
2.19.0