[RFT,5/5] i2c: sh_mobile: shorten exit of xfer routine

Message ID 20171102124731.10484-6-wsa+renesas@sang-engineering.com
State New
Headers show
Series
  • i2c: sh_mobile: refactor HW init/deinit
Related show

Commit Message

Wolfram Sang Nov. 2, 2017, 12:47 p.m.
We can use the ternary operator for easier reading.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/i2c/busses/i2c-sh_mobile.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch

diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 1701f193d94acf..39f0ee1cd78c74 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)