Message ID | 1416388299-4650-1-git-send-email-wsa@the-dreams.de |
---|---|
State | Accepted |
Headers | show |
Great, It's quite simpler than before. I should take more attention on make the code cleanly and efficiently. Best Regards, Yuan Yao > -----Original Message----- > From: Wolfram Sang [mailto:wsa@the-dreams.de] > Sent: Wednesday, November 19, 2014 5:12 PM > To: linux-i2c@vger.kernel.org > Cc: Yuan Yao-B46683; Wolfram Sang > Subject: [PATCH] i2c: imx: simplify i2c_imx_dma_write() a little > > Signed-off-by: Wolfram Sang <wsa@the-dreams.de> > --- > drivers/i2c/busses/i2c-imx.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > index d0668d0d626d..aab1f4bb9e30 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -657,11 +657,7 @@ static int i2c_imx_dma_write(struct imx_i2c_struct > *i2c_imx, > if (result) > return result; > > - result = i2c_imx_acked(i2c_imx); > - if (result) > - return result; > - > - return 0; > + return i2c_imx_acked(i2c_imx); > } > > static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx, > -- > 2.1.1 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Nov 19, 2014 at 10:15:34AM +0000, Yao Yuan wrote: > Great, It's quite simpler than before. > I should take more attention on make the code cleanly and efficiently. Don't worry, nobody is perfect!
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index d0668d0d626d..aab1f4bb9e30 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -657,11 +657,7 @@ static int i2c_imx_dma_write(struct imx_i2c_struct *i2c_imx, if (result) return result; - result = i2c_imx_acked(i2c_imx); - if (result) - return result; - - return 0; + return i2c_imx_acked(i2c_imx); } static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
Signed-off-by: Wolfram Sang <wsa@the-dreams.de> --- drivers/i2c/busses/i2c-imx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)