Commit 93316428 authored by Octavian Purdila's avatar Octavian Purdila Committed by Lee Jones

i2c: dln2: Simplify return flow for dln2_i2c_enable

This fixes the following kbuild test robot warning:

>> drivers/i2c/busses/i2c-dln2.c:70:1-4: WARNING: end returns can be simplified if negative or 0 value
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
Acked-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 7ca2b1c6
...@@ -54,7 +54,6 @@ struct dln2_i2c { ...@@ -54,7 +54,6 @@ struct dln2_i2c {
static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable) static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable)
{ {
int ret;
u16 cmd; u16 cmd;
struct { struct {
u8 port; u8 port;
...@@ -67,11 +66,7 @@ static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable) ...@@ -67,11 +66,7 @@ static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable)
else else
cmd = DLN2_I2C_DISABLE; cmd = DLN2_I2C_DISABLE;
ret = dln2_transfer_tx(dln2->pdev, cmd, &tx, sizeof(tx)); return dln2_transfer_tx(dln2->pdev, cmd, &tx, sizeof(tx));
if (ret < 0)
return ret;
return 0;
} }
static int dln2_i2c_write(struct dln2_i2c *dln2, u8 addr, static int dln2_i2c_write(struct dln2_i2c *dln2, u8 addr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment