dmaengine: shdma: SH_DMAC_MAX_CHANNELS message fix
Fix the recently added SH_DMAC_MAX_CHANNELS handling code in
300e5f9
dmaengine: shdma: Fix SH_DMAC_MAX_CHANNELS handling
Without this fix the shdma driver outputs silly messages in
case SH_DMAC_MAX_CHANNELS happens to match the platform data:
sh-dma-engine sh-dma-engine.0: Attempting to register 20 DMA channels when a max
imum of 20 are supported.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
parent
5bdbd4fa4d
commit
dcee0bb713
|
@ -1221,6 +1221,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
for (i = chanirq_res->start; i <= chanirq_res->end; i++) {
|
for (i = chanirq_res->start; i <= chanirq_res->end; i++) {
|
||||||
|
if (irq_cnt >= SH_DMAC_MAX_CHANNELS) {
|
||||||
|
irq_cap = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if ((errirq_res->flags & IORESOURCE_BITS) ==
|
if ((errirq_res->flags & IORESOURCE_BITS) ==
|
||||||
IORESOURCE_IRQ_SHAREABLE)
|
IORESOURCE_IRQ_SHAREABLE)
|
||||||
chan_flag[irq_cnt] = IRQF_SHARED;
|
chan_flag[irq_cnt] = IRQF_SHARED;
|
||||||
|
@ -1230,15 +1235,11 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
|
||||||
"Found IRQ %d for channel %d\n",
|
"Found IRQ %d for channel %d\n",
|
||||||
i, irq_cnt);
|
i, irq_cnt);
|
||||||
chan_irq[irq_cnt++] = i;
|
chan_irq[irq_cnt++] = i;
|
||||||
|
|
||||||
if (irq_cnt >= SH_DMAC_MAX_CHANNELS)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (irq_cnt >= SH_DMAC_MAX_CHANNELS) {
|
if (irq_cnt >= SH_DMAC_MAX_CHANNELS)
|
||||||
irq_cap = 1;
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
chanirq_res = platform_get_resource(pdev,
|
chanirq_res = platform_get_resource(pdev,
|
||||||
IORESOURCE_IRQ, ++irqres);
|
IORESOURCE_IRQ, ++irqres);
|
||||||
} while (irq_cnt < pdata->channel_num && chanirq_res);
|
} while (irq_cnt < pdata->channel_num && chanirq_res);
|
||||||
|
|
Loading…
Reference in a new issue