diff options
| author | Mark Brown <broonie@kernel.org> | 2025-06-27 14:07:07 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-06-27 14:07:07 +0300 |
| commit | 46e001c003e30ed830a69e46c13ea02cd35b6093 (patch) | |
| tree | 5ce7abbe0f8157cf1e95ddfba0d81339967c66de /include | |
| parent | ac4c064f67d3cdf9118b9b09c1e3b28b6c10a7ea (diff) | |
| parent | 2555691165a0285a4617230fed859f20dcc51608 (diff) | |
| download | linux-46e001c003e30ed830a69e46c13ea02cd35b6093.tar.xz | |
Add `devm_dma_request_chan()` to simplify probe
Merge series from Bence Csókás <csokas.bence@prolan.hu>:
The probe function of the atmel-quadspi driver got quite convoluted,
especially since the addition of SAMA7G5 support, that was forward-ported
from an older vendor kernel. To alleivate this - and similar problems in
the future - an effort was made to migrate as many functions as possible,
to their devm_ managed counterparts. Patch 1/2 adds the new
`devm_dma_request_chan()` function. Patch 2/2 then uses this APIs to
simplify the probe() function.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/dmaengine.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index bb146c5ac3e4..6de7c05d6bd8 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1524,6 +1524,7 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, struct dma_chan *dma_request_chan(struct device *dev, const char *name); struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask); +struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name); void dma_release_channel(struct dma_chan *chan); int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps); @@ -1560,6 +1561,12 @@ static inline struct dma_chan *dma_request_chan_by_mask( { return ERR_PTR(-ENODEV); } + +static inline struct dma_chan *devm_dma_request_chan(struct device *dev, const char *name) +{ + return ERR_PTR(-ENODEV); +} + static inline void dma_release_channel(struct dma_chan *chan) { } |
