[ARM] dma: ensure that the single entry sg is properly initialized

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Russell King 2008-12-08 17:50:25 +00:00 committed by Russell King
parent 8c56afcbea
commit d667522fdf

View File

@ -15,6 +15,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/scatterlist.h>
#include <asm/dma.h> #include <asm/dma.h>
@ -37,6 +38,9 @@ int __init isa_dma_add(unsigned int chan, dma_t *dma)
{ {
if (!dma->d_ops) if (!dma->d_ops)
return -EINVAL; return -EINVAL;
sg_init_table(&dma->buf, 1);
if (dma_chan[chan]) if (dma_chan[chan])
return -EBUSY; return -EBUSY;
dma_chan[chan] = dma; dma_chan[chan] = dma;