diff options
author | Krzysztof HaĆasa | 2013-09-12 13:25:36 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2013-10-14 11:32:04 +0200 |
commit | 4518274606d1fae701fc20912c0d24361c9e88cb (patch) | |
tree | 624ad8c0fc95d23fb494c8095e5647b489ee7e7c | |
parent | [media] snd_tea575x: precedence bug in fmr2_tea575x_get_pins() (diff) | |
download | kernel-qcow2-linux-4518274606d1fae701fc20912c0d24361c9e88cb.tar.gz kernel-qcow2-linux-4518274606d1fae701fc20912c0d24361c9e88cb.tar.xz kernel-qcow2-linux-4518274606d1fae701fc20912c0d24361c9e88cb.zip |
[media] SOLO6x10: don't do DMA from stack in solo_dma_vin_region()
[m.chehab@samsung.com: Fix CodingStyle: don't use 2 statements on just one line]
Signed-off-by: Krzysztof Ha?asa <khalasa@piap.pl>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/staging/media/solo6x10/solo6x10-disp.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/staging/media/solo6x10/solo6x10-disp.c b/drivers/staging/media/solo6x10/solo6x10-disp.c index 32d9953bc36e..145295a5db72 100644 --- a/drivers/staging/media/solo6x10/solo6x10-disp.c +++ b/drivers/staging/media/solo6x10/solo6x10-disp.c @@ -176,18 +176,27 @@ static void solo_vout_config(struct solo_dev *solo_dev) static int solo_dma_vin_region(struct solo_dev *solo_dev, u32 off, u16 val, int reg_size) { - u16 buf[64]; - int i; - int ret = 0; + u16 *buf; + const int n = 64, size = n * sizeof(*buf); + int i, ret = 0; + + buf = kmalloc(size, GFP_KERNEL); + if (!buf) + return -ENOMEM; - for (i = 0; i < sizeof(buf) >> 1; i++) + for (i = 0; i < n; i++) buf[i] = cpu_to_le16(val); - for (i = 0; i < reg_size; i += sizeof(buf)) - ret |= solo_p2m_dma(solo_dev, 1, buf, - SOLO_MOTION_EXT_ADDR(solo_dev) + off + i, - sizeof(buf), 0, 0); + for (i = 0; i < reg_size; i += size) { + ret = solo_p2m_dma(solo_dev, 1, buf, + SOLO_MOTION_EXT_ADDR(solo_dev) + off + i, + size, 0, 0); + + if (ret) + break; + } + kfree(buf); return ret; } |