From 9e3043c091819729ecf4fc5063d0a2d0954dfd7f Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Wed, 27 Sep 2006 16:55:24 +0900 Subject: [PATCH] sh: Fixup TEI IRQ requests in request_dma(). If a channel is not TEI capable, don't try to request_irq().. Signed-off-by: Paul Mundt --- arch/sh/drivers/dma/dma-sh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c index 4428ee80965..40a480d20aa 100644 --- a/arch/sh/drivers/dma/dma-sh.c +++ b/arch/sh/drivers/dma/dma-sh.c @@ -82,6 +82,9 @@ static int sh_dmac_request_dma(struct dma_channel *chan) { char name[32]; + if (unlikely(!chan->flags & DMA_TEI_CAPABLE)) + return 0; + snprintf(name, sizeof(name), "DMAC Transfer End (Channel %d)", chan->chan); @@ -255,7 +258,7 @@ static int __init sh_dmac_init(void) #ifdef CONFIG_CPU_SH4 make_ipr_irq(DMAE_IRQ, DMA_IPR_ADDR, DMA_IPR_POS, DMA_PRIORITY); i = request_irq(DMAE_IRQ, dma_err, IRQF_DISABLED, "DMAC Address Error", 0); - if (i < 0) + if (unlikely(i < 0)) return i; #endif @@ -270,7 +273,7 @@ static int __init sh_dmac_init(void) * been set. */ i = dmaor_reset(); - if (i < 0) + if (unlikely(i != 0)) return i; return register_dmac(info); -- 2.39.2