aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-07-02 11:37:58 -0400
committerVinod Koul <vinod.koul@intel.com>2013-08-25 02:18:22 -0400
commita28a94e84bca8ba7db66bcc0db1bea51840b08b2 (patch)
tree1ef5bf1356baa02e8d63991b6ed0c20f798b637f
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
DMA: shdma: fix CHCLR register address calculation
struct sh_dmae_device::chan_reg is a pointer to u32, therefore when adding offsets to it care should be taken to add offsets in sizeof(u32) units, not in bytes. This patch corrects such a bug. While at it we also remove the redundant parameter of the affected function. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/sh/shdma.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c
index b67f45f5c271..fca7a0cdfd28 100644
--- a/drivers/dma/sh/shdma.c
+++ b/drivers/dma/sh/shdma.c
@@ -49,12 +49,12 @@
49static DEFINE_SPINLOCK(sh_dmae_lock); 49static DEFINE_SPINLOCK(sh_dmae_lock);
50static LIST_HEAD(sh_dmae_devices); 50static LIST_HEAD(sh_dmae_devices);
51 51
52static void chclr_write(struct sh_dmae_chan *sh_dc, u32 data) 52static void channel_clear(struct sh_dmae_chan *sh_dc)
53{ 53{
54 struct sh_dmae_device *shdev = to_sh_dev(sh_dc); 54 struct sh_dmae_device *shdev = to_sh_dev(sh_dc);
55 55
56 __raw_writel(data, shdev->chan_reg + 56 __raw_writel(0, shdev->chan_reg +
57 shdev->pdata->channel[sh_dc->shdma_chan.id].chclr_offset); 57 shdev->pdata->channel[sh_dc->shdma_chan.id].chclr_offset / sizeof(u32));
58} 58}
59 59
60static void sh_dmae_writel(struct sh_dmae_chan *sh_dc, u32 data, u32 reg) 60static void sh_dmae_writel(struct sh_dmae_chan *sh_dc, u32 data, u32 reg)
@@ -133,7 +133,7 @@ static int sh_dmae_rst(struct sh_dmae_device *shdev)
133 for (i = 0; i < shdev->pdata->channel_num; i++) { 133 for (i = 0; i < shdev->pdata->channel_num; i++) {
134 struct sh_dmae_chan *sh_chan = shdev->chan[i]; 134 struct sh_dmae_chan *sh_chan = shdev->chan[i];
135 if (sh_chan) 135 if (sh_chan)
136 chclr_write(sh_chan, 0); 136 channel_clear(sh_chan);
137 } 137 }
138 } 138 }
139 139