summaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorNicholas Mc Guire <der.herr@hofr.at>2014-12-27 08:33:53 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-01-13 16:21:07 +0100
commitcb9eaba4c5dc16b4c00d7a86e4f5636c4edf964c (patch)
treec1da4934f12aece3cff20acf9a48a734d1562036 /drivers/i2c
parent387f0de6c37380ad72bb92bb621f23555dd4c42e (diff)
downloadlinux-cb9eaba4c5dc16b4c00d7a86e4f5636c4edf964c.tar.gz
linux-cb9eaba4c5dc16b4c00d7a86e4f5636c4edf964c.tar.bz2
linux-cb9eaba4c5dc16b4c00d7a86e4f5636c4edf964c.zip
i2c: imx: fix handling of wait_for_completion_timeout result
wait_for_completion_timeout does not return negative values so "result" handling here should be simplified to cover the actually possible cases only. Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-imx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 7f3a9fe9bf4e..2be7d9d6d1b3 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -628,9 +628,9 @@ static int i2c_imx_dma_write(struct imx_i2c_struct *i2c_imx,
result = wait_for_completion_timeout(
&i2c_imx->dma->cmd_complete,
msecs_to_jiffies(DMA_TIMEOUT));
- if (result <= 0) {
+ if (result == 0) {
dmaengine_terminate_all(dma->chan_using);
- return result ?: -ETIMEDOUT;
+ return -ETIMEDOUT;
}
/* Waiting for transfer complete. */
@@ -686,9 +686,9 @@ static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
result = wait_for_completion_timeout(
&i2c_imx->dma->cmd_complete,
msecs_to_jiffies(DMA_TIMEOUT));
- if (result <= 0) {
+ if (result == 0) {
dmaengine_terminate_all(dma->chan_using);
- return result ?: -ETIMEDOUT;
+ return -ETIMEDOUT;
}
/* waiting for transfer complete. */