]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ata: pata_arasan_cf: Use dma_request_chan() instead dma_request_slave_channel()
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 13 Jan 2020 14:27:47 +0000 (16:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 30 Jan 2020 04:13:25 +0000 (21:13 -0700)
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

The dma_request_chan() is the standard API to request slave channel,
clients should be moved away from the legacy API to allow us to retire
them.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/pata_arasan_cf.c

index 391dff0f25a2ba61943ddd63b26c11b4c27cc9e7..e9cf31f38450607caa585d4ea7edbc1300c477f5 100644 (file)
@@ -526,9 +526,10 @@ static void data_xfer(struct work_struct *work)
 
        /* request dma channels */
        /* dma_request_channel may sleep, so calling from process context */
-       acdev->dma_chan = dma_request_slave_channel(acdev->host->dev, "data");
-       if (!acdev->dma_chan) {
+       acdev->dma_chan = dma_request_chan(acdev->host->dev, "data");
+       if (IS_ERR(acdev->dma_chan)) {
                dev_err(acdev->host->dev, "Unable to get dma_chan\n");
+               acdev->dma_chan = NULL;
                goto chan_request_fail;
        }
 
@@ -539,6 +540,7 @@ static void data_xfer(struct work_struct *work)
        }
 
        dma_release_channel(acdev->dma_chan);
+       acdev->dma_chan = NULL;
 
        /* data xferred successfully */
        if (!ret) {