.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * i2c-stm32.c |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) M'boumba Cedric Madianga 2017 |
---|
5 | 6 | * Author: M'boumba Cedric Madianga <cedric.madianga@gmail.com> |
---|
6 | | - * |
---|
7 | | - * License terms: GNU General Public License (GPL), version 2 |
---|
8 | 7 | */ |
---|
9 | 8 | |
---|
10 | 9 | #include "i2c-stm32.h" |
---|
.. | .. |
---|
26 | 25 | /* Request and configure I2C TX dma channel */ |
---|
27 | 26 | dma->chan_tx = dma_request_chan(dev, "tx"); |
---|
28 | 27 | if (IS_ERR(dma->chan_tx)) { |
---|
29 | | - dev_dbg(dev, "can't request DMA tx channel\n"); |
---|
30 | 28 | 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"); |
---|
31 | 32 | goto fail_al; |
---|
32 | 33 | } |
---|
33 | 34 | |
---|
.. | .. |
---|
45 | 46 | /* Request and configure I2C RX dma channel */ |
---|
46 | 47 | dma->chan_rx = dma_request_chan(dev, "rx"); |
---|
47 | 48 | if (IS_ERR(dma->chan_rx)) { |
---|
48 | | - dev_err(dev, "can't request DMA rx channel\n"); |
---|
49 | 49 | 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 | + |
---|
50 | 54 | goto fail_tx; |
---|
51 | 55 | } |
---|
52 | 56 | |
---|
.. | .. |
---|
74 | 78 | dma_release_channel(dma->chan_tx); |
---|
75 | 79 | fail_al: |
---|
76 | 80 | devm_kfree(dev, dma); |
---|
77 | | - dev_info(dev, "can't use DMA\n"); |
---|
78 | 81 | |
---|
79 | 82 | return ERR_PTR(ret); |
---|
80 | 83 | } |
---|