diff options
| -rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index fa9ad53845d9..e28ef494dac8 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
| @@ -285,9 +285,11 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, | |||
| 285 | if (!dma) | 285 | if (!dma) |
| 286 | return; | 286 | return; |
| 287 | 287 | ||
| 288 | dma->chan_tx = dma_request_slave_channel(dev, "tx"); | 288 | dma->chan_tx = dma_request_chan(dev, "tx"); |
| 289 | if (!dma->chan_tx) { | 289 | if (IS_ERR(dma->chan_tx)) { |
| 290 | dev_dbg(dev, "can't request DMA tx channel\n"); | 290 | ret = PTR_ERR(dma->chan_rx); |
| 291 | if (ret != -ENODEV && ret != -EPROBE_DEFER) | ||
| 292 | dev_err(dev, "can't request DMA tx channel (%d)\n", ret); | ||
| 291 | goto fail_al; | 293 | goto fail_al; |
| 292 | } | 294 | } |
| 293 | 295 | ||
| @@ -298,13 +300,15 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, | |||
| 298 | dma_sconfig.direction = DMA_MEM_TO_DEV; | 300 | dma_sconfig.direction = DMA_MEM_TO_DEV; |
| 299 | ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig); | 301 | ret = dmaengine_slave_config(dma->chan_tx, &dma_sconfig); |
| 300 | if (ret < 0) { | 302 | if (ret < 0) { |
| 301 | dev_dbg(dev, "can't configure tx channel\n"); | 303 | dev_err(dev, "can't configure tx channel (%d)\n", ret); |
| 302 | goto fail_tx; | 304 | goto fail_tx; |
| 303 | } | 305 | } |
| 304 | 306 | ||
| 305 | dma->chan_rx = dma_request_slave_channel(dev, "rx"); | 307 | dma->chan_rx = dma_request_chan(dev, "rx"); |
| 306 | if (!dma->chan_rx) { | 308 | if (IS_ERR(dma->chan_rx)) { |
| 307 | dev_dbg(dev, "can't request DMA rx channel\n"); | 309 | ret = PTR_ERR(dma->chan_rx); |
| 310 | if (ret != -ENODEV && ret != -EPROBE_DEFER) | ||
| 311 | dev_err(dev, "can't request DMA rx channel (%d)\n", ret); | ||
| 308 | goto fail_tx; | 312 | goto fail_tx; |
| 309 | } | 313 | } |
| 310 | 314 | ||
| @@ -315,7 +319,7 @@ static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx, | |||
| 315 | dma_sconfig.direction = DMA_DEV_TO_MEM; | 319 | dma_sconfig.direction = DMA_DEV_TO_MEM; |
| 316 | ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig); | 320 | ret = dmaengine_slave_config(dma->chan_rx, &dma_sconfig); |
| 317 | if (ret < 0) { | 321 | if (ret < 0) { |
| 318 | dev_dbg(dev, "can't configure rx channel\n"); | 322 | dev_err(dev, "can't configure rx channel (%d)\n", ret); |
| 319 | goto fail_rx; | 323 | goto fail_rx; |
| 320 | } | 324 | } |
| 321 | 325 | ||
| @@ -332,7 +336,6 @@ fail_tx: | |||
| 332 | dma_release_channel(dma->chan_tx); | 336 | dma_release_channel(dma->chan_tx); |
| 333 | fail_al: | 337 | fail_al: |
| 334 | devm_kfree(dev, dma); | 338 | devm_kfree(dev, dma); |
| 335 | dev_info(dev, "can't use DMA, using PIO instead.\n"); | ||
| 336 | } | 339 | } |
| 337 | 340 | ||
| 338 | static void i2c_imx_dma_callback(void *arg) | 341 | static void i2c_imx_dma_callback(void *arg) |
