Skip to content

Commit

Permalink
dmaengine i.MX SDMA: set firmware scripts addresses to negative value…
Browse files Browse the repository at this point in the history
… initially

If we do not have a firmare script for a given transfer,
the setup of this channel must fail. For this the script
addresses have to be < 0 initially, not 0.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Sascha Hauer authored and Vinod Koul committed Aug 29, 2011
1 parent 73eab97 commit 36e2f21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/dma/imx-sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,7 @@ static int __init sdma_probe(struct platform_device *pdev)
struct sdma_platform_data *pdata = pdev->dev.platform_data;
int i;
struct sdma_engine *sdma;
s32 *saddr_arr;

sdma = kzalloc(sizeof(*sdma), GFP_KERNEL);
if (!sdma)
Expand Down Expand Up @@ -1324,6 +1325,11 @@ static int __init sdma_probe(struct platform_device *pdev)
goto err_alloc;
}

/* initially no scripts available */
saddr_arr = (s32 *)sdma->script_addrs;
for (i = 0; i < SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1; i++)
saddr_arr[i] = -EINVAL;

if (of_id)
pdev->id_entry = of_id->data;
sdma->devtype = pdev->id_entry->driver_data;
Expand Down

0 comments on commit 36e2f21

Please sign in to comment.