From e5abf78b57199a417eb01ff922a5ea6ff9e10b61 Mon Sep 17 00:00:00 2001 From: GuanXuetao Date: Sat, 26 Feb 2011 21:21:18 +0800 Subject: unicore32 io: redefine __REG(x) and re-use readl/writel funcs -- by advice of Arnd Bergmann Signed-off-by: Guan Xuetao Reviewed-by: Arnd Bergmann --- arch/unicore32/kernel/dma.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'arch/unicore32/kernel/dma.c') diff --git a/arch/unicore32/kernel/dma.c b/arch/unicore32/kernel/dma.c index b8dcc25..ae441bc 100644 --- a/arch/unicore32/kernel/dma.c +++ b/arch/unicore32/kernel/dma.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -94,15 +95,16 @@ EXPORT_SYMBOL(puv3_free_dma); static irqreturn_t dma_irq_handler(int irq, void *dev_id) { - int i, dint = DMAC_ITCSR; + int i, dint; + dint = readl(DMAC_ITCSR); for (i = 0; i < MAX_DMA_CHANNELS; i++) { if (dint & DMAC_CHANNEL(i)) { struct dma_channel *channel = &dma_channels[i]; /* Clear TC interrupt of channel i */ - DMAC_ITCCR = DMAC_CHANNEL(i); - DMAC_ITCCR = 0; + writel(DMAC_CHANNEL(i), DMAC_ITCCR); + writel(0, DMAC_ITCCR); if (channel->name && channel->irq_handler) { channel->irq_handler(i, channel->data); @@ -121,15 +123,16 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id) static irqreturn_t dma_err_handler(int irq, void *dev_id) { - int i, dint = DMAC_IESR; + int i, dint; + dint = readl(DMAC_IESR); for (i = 0; i < MAX_DMA_CHANNELS; i++) { if (dint & DMAC_CHANNEL(i)) { struct dma_channel *channel = &dma_channels[i]; /* Clear Err interrupt of channel i */ - DMAC_IECR = DMAC_CHANNEL(i); - DMAC_IECR = 0; + writel(DMAC_CHANNEL(i), DMAC_IECR); + writel(0, DMAC_IECR); if (channel->name && channel->err_handler) { channel->err_handler(i, channel->data); -- cgit v1.1