aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2013-07-02 17:37:58 +0200
committerVinod Koul <vinod.koul@intel.com>2013-08-25 11:48:22 +0530
commita28a94e84bca8ba7db66bcc0db1bea51840b08b2 (patch)
tree1ef5bf1356baa02e8d63991b6ed0c20f798b637f /drivers/dma
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
downloadkernel_goldelico_gta04-a28a94e84bca8ba7db66bcc0db1bea51840b08b2.zip
kernel_goldelico_gta04-a28a94e84bca8ba7db66bcc0db1bea51840b08b2.tar.gz
kernel_goldelico_gta04-a28a94e84bca8ba7db66bcc0db1bea51840b08b2.tar.bz2
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>
Diffstat (limited to 'drivers/dma')
-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 b67f45f..fca7a0c 100644
--- a/drivers/dma/sh/shdma.c
+++ b/drivers/dma/sh/shdma.c
@@ -49,12 +49,12 @@
static DEFINE_SPINLOCK(sh_dmae_lock);
static LIST_HEAD(sh_dmae_devices);
-static void chclr_write(struct sh_dmae_chan *sh_dc, u32 data)
+static void channel_clear(struct sh_dmae_chan *sh_dc)
{
struct sh_dmae_device *shdev = to_sh_dev(sh_dc);
- __raw_writel(data, shdev->chan_reg +
- shdev->pdata->channel[sh_dc->shdma_chan.id].chclr_offset);
+ __raw_writel(0, shdev->chan_reg +
+ shdev->pdata->channel[sh_dc->shdma_chan.id].chclr_offset / sizeof(u32));
}
static 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)
for (i = 0; i < shdev->pdata->channel_num; i++) {
struct sh_dmae_chan *sh_chan = shdev->chan[i];
if (sh_chan)
- chclr_write(sh_chan, 0);
+ channel_clear(sh_chan);
}
}