]> git.itanic.dy.fi Git - linux-stable/commitdiff
spi: ingenic: convert not to use dma_request_slave_channel()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 19 Nov 2023 10:59:50 +0000 (11:59 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 20 Nov 2023 13:13:37 +0000 (13:13 +0000)
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>
drivers/spi/spi-ingenic.c

index cc366936d72b183205ee743d6e8e3b5b7cc56152..003a6d21c4c3e815adc8664b95ace839b6ddfc9e 100644 (file)
@@ -346,14 +346,17 @@ static bool spi_ingenic_can_dma(struct spi_controller *ctlr,
 static int spi_ingenic_request_dma(struct spi_controller *ctlr,
                                   struct device *dev)
 {
-       ctlr->dma_tx = dma_request_slave_channel(dev, "tx");
-       if (!ctlr->dma_tx)
-               return -ENODEV;
+       struct dma_chan *chan;
 
-       ctlr->dma_rx = dma_request_slave_channel(dev, "rx");
+       chan = dma_request_chan(dev, "tx");
+       if (IS_ERR(chan))
+               return PTR_ERR(chan);
+       ctlr->dma_tx = chan;
 
-       if (!ctlr->dma_rx)
-               return -ENODEV;
+       chan = dma_request_chan(dev, "rx");
+       if (IS_ERR(chan))
+               return PTR_ERR(chan);
+       ctlr->dma_rx = chan;
 
        ctlr->can_dma = spi_ingenic_can_dma;