diff options
author | Alain Volmat <alain.volmat@st.com> | 2020-09-14 13:40:33 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2020-09-21 12:45:43 +0300 |
commit | 27c90870e7018cd5b93991ca398444a9b0f74113 (patch) | |
tree | fcddd982f3fef22624d2f68b8e5eeeecefe84556 /drivers/i2c/busses/i2c-stm32.c | |
parent | 8ce98dd21fcfaab3b6177cfc167d6b6b71dc9fc1 (diff) | |
download | linux-27c90870e7018cd5b93991ca398444a9b0f74113.tar.xz |
i2c: stm32: fix error message on upon dma_request_chan & defer handling
DMA usage is optional for the I2C driver. check for the -ENODEV
error in order to avoid displaying an error when no DMA
has been requested.
Cleaning up the error messages during probe, remove the additional
-EPROBE_DEFER within probe function since additional error message
doesn't give much more information than what is already reported
within the stm32_i2c_dma_request function.
Signed-off-by: Alain Volmat <alain.volmat@st.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-stm32.c')
-rw-r--r-- | drivers/i2c/busses/i2c-stm32.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-stm32.c b/drivers/i2c/busses/i2c-stm32.c index 3f69a3bb6119..468620db9ea5 100644 --- a/drivers/i2c/busses/i2c-stm32.c +++ b/drivers/i2c/busses/i2c-stm32.c @@ -26,7 +26,7 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev, dma->chan_tx = dma_request_chan(dev, "tx"); if (IS_ERR(dma->chan_tx)) { ret = PTR_ERR(dma->chan_tx); - if (ret != -EPROBE_DEFER) + if ((ret != -ENODEV) && (ret != -EPROBE_DEFER)) dev_err(dev, "can't request DMA tx channel\n"); goto fail_al; } @@ -46,7 +46,7 @@ struct stm32_i2c_dma *stm32_i2c_dma_request(struct device *dev, dma->chan_rx = dma_request_chan(dev, "rx"); if (IS_ERR(dma->chan_rx)) { ret = PTR_ERR(dma->chan_rx); - if (ret != -EPROBE_DEFER) + if ((ret != -ENODEV) && (ret != -EPROBE_DEFER)) dev_err(dev, "can't request DMA rx channel\n"); goto fail_tx; @@ -76,8 +76,6 @@ fail_tx: dma_release_channel(dma->chan_tx); fail_al: devm_kfree(dev, dma); - if (ret != -EPROBE_DEFER) - dev_info(dev, "can't use DMA\n"); return ERR_PTR(ret); } |