Skip to content

Commit d3bb2cb

Browse files
tititiou36broonie
authored andcommitted
spi: ingenic: convert not to use dma_request_slave_channel()
dma_request_slave_channel() is deprecated. dma_request_chan() should be used directly instead. Switch to the preferred function and update the error handling accordingly. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/1c88236b5d6bff0af902492ea9e066c8cb0dfef5.1700391566.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 18a813a commit d3bb2cb

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

drivers/spi/spi-ingenic.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,17 @@ static bool spi_ingenic_can_dma(struct spi_controller *ctlr,
346346
static int spi_ingenic_request_dma(struct spi_controller *ctlr,
347347
struct device *dev)
348348
{
349-
ctlr->dma_tx = dma_request_slave_channel(dev, "tx");
350-
if (!ctlr->dma_tx)
351-
return -ENODEV;
349+
struct dma_chan *chan;
352350

353-
ctlr->dma_rx = dma_request_slave_channel(dev, "rx");
351+
chan = dma_request_chan(dev, "tx");
352+
if (IS_ERR(chan))
353+
return PTR_ERR(chan);
354+
ctlr->dma_tx = chan;
354355

355-
if (!ctlr->dma_rx)
356-
return -ENODEV;
356+
chan = dma_request_chan(dev, "rx");
357+
if (IS_ERR(chan))
358+
return PTR_ERR(chan);
359+
ctlr->dma_rx = chan;
357360

358361
ctlr->can_dma = spi_ingenic_can_dma;
359362

0 commit comments

Comments
 (0)