Skip to content

Commit 8f2efdb

Browse files
Wolfram Sangalexandrebelloni
authored andcommitted
rtc: sh: assign correct interrupts with DT
The DT bindings for this driver define the interrupts in the order as they are numbered in the interrupt controller. The old platform_data, however, listed them in a different order. So, for DT based platforms, they are mixed up. Assign them specifically for DT, so we can keep the bindings stable. After the fix, 'rtctest' passes again on the Renesas Genmai board (RZ-A1 / R7S72100). Fixes: dab5aec ("rtc: sh: add support for rza series") Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 0af2f6b commit 8f2efdb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/rtc/rtc-sh.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,15 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
485485
return -ENOENT;
486486
}
487487

488-
rtc->periodic_irq = ret;
489-
rtc->carry_irq = platform_get_irq(pdev, 1);
490-
rtc->alarm_irq = platform_get_irq(pdev, 2);
488+
if (!pdev->dev.of_node) {
489+
rtc->periodic_irq = ret;
490+
rtc->carry_irq = platform_get_irq(pdev, 1);
491+
rtc->alarm_irq = platform_get_irq(pdev, 2);
492+
} else {
493+
rtc->alarm_irq = ret;
494+
rtc->periodic_irq = platform_get_irq(pdev, 1);
495+
rtc->carry_irq = platform_get_irq(pdev, 2);
496+
}
491497

492498
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
493499
if (!res)

0 commit comments

Comments
 (0)