i2c: sh_mobile: shorten exit of xfer routine
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 2 Nov 2017 12:47:31 +0000 (13:47 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 27 Nov 2017 17:53:12 +0000 (18:53 +0100)
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>
drivers/i2c/busses/i2c-sh_mobile.c

index 72c9483..ebd146c 100644 (file)
@@ -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)