aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOctavian Purdila <octavian.purdila@intel.com>2014-11-18 07:57:58 -0500
committerLee Jones <lee.jones@linaro.org>2014-11-19 12:12:37 -0500
commit9331642812b19313ca4c545b37c001d68efb7022 (patch)
tree4ca83613a77752f700b816398c5e29ffd99e294e
parent7ca2b1c6724b150d8305ce06e4b07904ecbcb3fb (diff)
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: kbuild test robot <fengguang.wu@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Octavian Purdila <octavian.purdila@intel.com> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/i2c/busses/i2c-dln2.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-dln2.c b/drivers/i2c/busses/i2c-dln2.c
index 010a5fa8c883..b3fb86af4cbb 100644
--- a/drivers/i2c/busses/i2c-dln2.c
+++ b/drivers/i2c/busses/i2c-dln2.c
@@ -54,7 +54,6 @@ struct dln2_i2c {
54 54
55static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable) 55static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable)
56{ 56{
57 int ret;
58 u16 cmd; 57 u16 cmd;
59 struct { 58 struct {
60 u8 port; 59 u8 port;
@@ -67,11 +66,7 @@ static int dln2_i2c_enable(struct dln2_i2c *dln2, bool enable)
67 else 66 else
68 cmd = DLN2_I2C_DISABLE; 67 cmd = DLN2_I2C_DISABLE;
69 68
70 ret = dln2_transfer_tx(dln2->pdev, cmd, &tx, sizeof(tx)); 69 return dln2_transfer_tx(dln2->pdev, cmd, &tx, sizeof(tx));
71 if (ret < 0)
72 return ret;
73
74 return 0;
75} 70}
76 71
77static int dln2_i2c_write(struct dln2_i2c *dln2, u8 addr, 72static int dln2_i2c_write(struct dln2_i2c *dln2, u8 addr,