Commit 5b3a23a3 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by Wolfram Sang

i2c: imx: notify about real errors on dma i2c_imx_dma_request

At least on i.MX5x, the DMA events for I2C and SDHC use the same channel
and there can only be a single user. So in this case there should be no
message emitted that looks like an error if the I2C device doesn't have
an assigned DMA channel. In contrast real problems that were only
emitted at debug level before should be described at a higher level
to be better visible and so understandable.
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 18569fa8
...@@ -285,9 +285,11 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, ...@@ -285,9 +285,11 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
if (!dma) if (!dma)
return; return;
dma->chan_tx = dma_request_slave_channel(dev, "tx"); dma->chan_tx = dma_request_chan(dev, "tx");
if (!dma->chan_tx) { if (IS_ERR(dma->chan_tx)) {
dev_dbg(dev, "can't request DMA tx channel\n"); ret = PTR_ERR(dma->chan_rx);
if (ret != -ENODEV && ret != -EPROBE_DEFER)
dev_err(dev, "can't request DMA tx channel (%d)\n", ret);
goto fail_al; goto fail_al;
} }
...@@ -298,13 +300,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, ...@@ -298,13 +300,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
dma_sconfig.direction = DMA_MEM_TO_DEV; dma_sconfig.direction = DMA_MEM_TO_DEV;
ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig); ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig);
if (ret < 0) { if (ret < 0) {
dev_dbg(dev, "can't configure tx channel\n"); dev_err(dev, "can't configure tx channel (%d)\n", ret);
goto fail_tx; goto fail_tx;
} }
dma->chan_rx = dma_request_slave_channel(dev, "rx"); dma->chan_rx = dma_request_chan(dev, "rx");
if (!dma->chan_rx) { if (IS_ERR(dma->chan_rx)) {
dev_dbg(dev, "can't request DMA rx channel\n"); ret = PTR_ERR(dma->chan_rx);
if (ret != -ENODEV && ret != -EPROBE_DEFER)
dev_err(dev, "can't request DMA rx channel (%d)\n", ret);
goto fail_tx; goto fail_tx;
} }
...@@ -315,7 +319,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, ...@@ -315,7 +319,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
dma_sconfig.direction = DMA_DEV_TO_MEM; dma_sconfig.direction = DMA_DEV_TO_MEM;
ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig); ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig);
if (ret < 0) { if (ret < 0) {
dev_dbg(dev, "can't configure rx channel\n"); dev_err(dev, "can't configure rx channel (%d)\n", ret);
goto fail_rx; goto fail_rx;
} }
...@@ -332,7 +336,6 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, ...@@ -332,7 +336,6 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
dma_release_channel(dma->chan_tx); dma_release_channel(dma->chan_tx);
fail_al: fail_al:
devm_kfree(dev, dma); devm_kfree(dev, dma);
dev_info(dev, "can't use DMA, using PIO instead.\n");
} }
static void i2c_imx_dma_callback(void *arg) static void i2c_imx_dma_callback(void *arg)
......
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