diff mbox series

ata: pata_arasam_cf: Use dma_request_chan() instead dma_request_slave_channel()

Message ID 20191217105048.25327-1-peter.ujfalusi@ti.com
State Accepted
Commit 7991901082f0626592885a77a2cf8162536d1a51
Headers show
Series ata: pata_arasam_cf: Use dma_request_chan() instead dma_request_slave_channel() | expand

Commit Message

Peter Ujfalusi Dec. 17, 2019, 10:50 a.m. UTC
dma_request_slave_channel() is a wrapper on top of dma_request_chan()
eating up the error code.

By using dma_request_chan() directly the driver can support deferred
probing against DMA.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

---
 drivers/ata/pata_arasan_cf.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Comments

Viresh Kumar Dec. 17, 2019, 11:19 a.m. UTC | #1
On 17-12-19, 12:50, Peter Ujfalusi wrote:
> dma_request_slave_channel() is a wrapper on top of dma_request_chan()

> eating up the error code.

> 

> By using dma_request_chan() directly the driver can support deferred

> probing against DMA.

> 

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> ---

>  drivers/ata/pata_arasan_cf.c | 6 ++++--

>  1 file changed, 4 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c

> index 135173c8d138..69b555d83f68 100644

> --- a/drivers/ata/pata_arasan_cf.c

> +++ b/drivers/ata/pata_arasan_cf.c

> @@ -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) {


Acked-by: Viresh Kumar <viresh.kumar@linaro.org>


-- 
viresh
diff mbox series

Patch

diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 135173c8d138..69b555d83f68 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -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) {