hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/busses/i2c-stm32.c
....@@ -1,10 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * i2c-stm32.c
34 *
45 * Copyright (C) M'boumba Cedric Madianga 2017
56 * Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com>
6
- *
7
- * License terms: GNU General Public License (GPL), version 2
87 */
98
109 #include "i2c-stm32.h"
....@@ -26,8 +25,10 @@
2625 /* Request and configure I2C TX dma channel */
2726 dma->chan_tx = dma_request_chan(dev, "tx");
2827 if (IS_ERR(dma->chan_tx)) {
29
- dev_dbg(dev, "can't request DMA tx channel\n");
3028 ret = PTR_ERR(dma->chan_tx);
29
+ if (ret != -ENODEV)
30
+ ret = dev_err_probe(dev, ret,
31
+ "can't request DMA tx channel\n");
3132 goto fail_al;
3233 }
3334
....@@ -45,8 +46,11 @@
4546 /* Request and configure I2C RX dma channel */
4647 dma->chan_rx = dma_request_chan(dev, "rx");
4748 if (IS_ERR(dma->chan_rx)) {
48
- dev_err(dev, "can't request DMA rx channel\n");
4949 ret = PTR_ERR(dma->chan_rx);
50
+ if (ret != -ENODEV)
51
+ ret = dev_err_probe(dev, ret,
52
+ "can't request DMA rx channel\n");
53
+
5054 goto fail_tx;
5155 }
5256
....@@ -74,7 +78,6 @@
7478 dma_release_channel(dma->chan_tx);
7579 fail_al:
7680 devm_kfree(dev, dma);
77
- dev_info(dev, "can't use DMA\n");
7881
7982 return ERR_PTR(ret);
8083 }