diff mbox

DaVinci: Update for edma_alloc_cont_slots API

Message ID 1252681451-18508-1-git-send-email-s-paulraj@ti.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

s-paulraj@ti.com Sept. 11, 2009, 3:04 p.m. UTC
From: Sandeep Paulraj <s-paulraj@ti.com>

The edma_alloc_cont_slots API is used for obtaining a set of
contiguous slots. When we use the "_ANY" option with this
API, by definition of this option it is suppossed to start
looking for a set of contiguous slots starting from slot 64 for
DaVinci SOC's and 32 for Primus. This has been explained in
the API description in the driver itself. So when we use the
"_ANY" option with this API, the slot number passed as
an argument should be a "don't care".
This patch takes care of this condition mentioned above.
When checking to see if the starting slot is a valid number,
it checks to make sure that the "_ANY" option is not used.

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
 arch/arm/mach-davinci/dma.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Comments

s-paulraj@ti.com Sept. 11, 2009, 7:56 p.m. UTC | #1
Please ignore this patch.
I will send an updated patch

> -----Original Message-----
> From: Paulraj, Sandeep
> Sent: Friday, September 11, 2009 11:04 AM
> To: davinci-linux-open-source@linux.davincidsp.com
> Cc: Paulraj, Sandeep
> Subject: [PATCH] DaVinci: Update for edma_alloc_cont_slots API
> 
> From: Sandeep Paulraj <s-paulraj@ti.com>
> 
> The edma_alloc_cont_slots API is used for obtaining a set of
> contiguous slots. When we use the "_ANY" option with this
> API, by definition of this option it is suppossed to start
> looking for a set of contiguous slots starting from slot 64 for
> DaVinci SOC's and 32 for Primus. This has been explained in
> the API description in the driver itself. So when we use the
> "_ANY" option with this API, the slot number passed as
> an argument should be a "don't care".
> This patch takes care of this condition mentioned above.
> When checking to see if the starting slot is a valid number,
> it checks to make sure that the "_ANY" option is not used.
> 
> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
> ---
>  arch/arm/mach-davinci/dma.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
> index f2e57d2..a1bb760 100644
> --- a/arch/arm/mach-davinci/dma.c
> +++ b/arch/arm/mach-davinci/dma.c
> @@ -771,8 +771,9 @@ int edma_alloc_cont_slots(unsigned ctlr, unsigned int
> id, int slot, int count)
>  	 * the number of channels and lesser than the total number
>  	 * of slots
>  	 */
> -	if (slot < edma_info[ctlr]->num_channels ||
> -		slot >= edma_info[ctlr]->num_slots)
> +	if ((id != EDMA_CONT_PARAMS_ANY) &&
> +		(slot < edma_info[ctlr]->num_channels ||
> +		slot >= edma_info[ctlr]->num_slots))
>  		return -EINVAL;
> 
>  	/*
> --
> 1.6.0.4
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/dma.c b/arch/arm/mach-davinci/dma.c
index f2e57d2..a1bb760 100644
--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/mach-davinci/dma.c
@@ -771,8 +771,9 @@  int edma_alloc_cont_slots(unsigned ctlr, unsigned int id, int slot, int count)
 	 * the number of channels and lesser than the total number
 	 * of slots
 	 */
-	if (slot < edma_info[ctlr]->num_channels ||
-		slot >= edma_info[ctlr]->num_slots)
+	if ((id != EDMA_CONT_PARAMS_ANY) &&
+		(slot < edma_info[ctlr]->num_channels ||
+		slot >= edma_info[ctlr]->num_slots))
 		return -EINVAL;
 
 	/*