Patchwork [2/4] sata_dwc_460ex: fix return value of dma_dwc_xfer_setup()

login
register
mail settings
Submitter Sergei Shtylyov
Date Jan. 28, 2011, 6:58 p.m.
Message ID <201101282158.54462.sshtylyov@ru.mvista.com>
Download mbox | patch
Permalink /patch/80881/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Sergei Shtylyov - Jan. 28, 2011, 6:58 p.m.
The caller expects this function to return the DMA channel number on success,
while it returns 0...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
The patch is against the recent Linus' tree.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Sergei Shtylyov - Feb. 16, 2011, 6:33 p.m.
Hello.

I wrote:

> The caller expects this function to return the DMA channel number on success,
> while it returns 0...

> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> ---
> The patch is against the recent Linus' tree.

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

> Index: linux-2.6/drivers/ata/sata_dwc_460ex.c
> ===================================================================
> --- linux-2.6.orig/drivers/ata/sata_dwc_460ex.c
> +++ linux-2.6/drivers/ata/sata_dwc_460ex.c
> @@ -44,7 +44,7 @@
>  #undef	DRV_NAME
>  #undef	DRV_VERSION
>  #define DRV_NAME        "sata-dwc"
> -#define DRV_VERSION     "1.1"
> +#define DRV_VERSION     "1.2"
>  
>  /* SATA DMA driver Globals */
>  #define DMA_NUM_CHANS		1
> @@ -718,7 +718,7 @@ static int dma_dwc_xfer_setup(struct sca
>  	/* Program the CTL register with src enable / dst enable */
>  	out_le32(&(host_pvt.sata_dma_regs->chan_regs[dma_ch].ctl.low),
>  		 DMA_CTL_LLP_SRCEN | DMA_CTL_LLP_DSTEN);
> -	return 0;
> +	return dma_ch;
>  }

    Does not seem a real issue as DMA_NUM_CHANS is 1. How NCQ is going to work 
though with 1 DMA channel? :-O

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Index: linux-2.6/drivers/ata/sata_dwc_460ex.c
===================================================================
--- linux-2.6.orig/drivers/ata/sata_dwc_460ex.c
+++ linux-2.6/drivers/ata/sata_dwc_460ex.c
@@ -44,7 +44,7 @@ 
 #undef	DRV_NAME
 #undef	DRV_VERSION
 #define DRV_NAME        "sata-dwc"
-#define DRV_VERSION     "1.1"
+#define DRV_VERSION     "1.2"
 
 /* SATA DMA driver Globals */
 #define DMA_NUM_CHANS		1
@@ -718,7 +718,7 @@  static int dma_dwc_xfer_setup(struct sca
 	/* Program the CTL register with src enable / dst enable */
 	out_le32(&(host_pvt.sata_dma_regs->chan_regs[dma_ch].ctl.low),
 		 DMA_CTL_LLP_SRCEN | DMA_CTL_LLP_DSTEN);
-	return 0;
+	return dma_ch;
 }
 
 /*