clocksource: sh_tmu: Fix channel IRQ retrieval in legacy case
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 16 May 2014 12:44:23 +0000 (14:44 +0200)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Wed, 4 Feb 2015 10:14:45 +0000 (11:14 +0100)
In the legacy platform data case each TMU platform device handles a
single channel with a single IRQ for the platform device. Retrieve the
IRQ using the logical channel number instead of the hardware channel
number.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
(cherry picked from commit c54697ae180e652a96db8bc71f0c7c7baee2bf16)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/clocksource/sh_tmu.c

index 4ba2c0f..ec34095 100644 (file)
@@ -498,7 +498,7 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch, unsigned int index,
                        ch->base = tmu->mapbase + 8 + ch->index * 12;
        }
 
-       ch->irq = platform_get_irq(tmu->pdev, ch->index);
+       ch->irq = platform_get_irq(tmu->pdev, index);
        if (ch->irq < 0) {
                dev_err(&tmu->pdev->dev, "ch%u: failed to get irq\n",
                        ch->index);