ARM: 7515/1: integrator: check PL010 base address from resource
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 6 Sep 2012 08:07:27 +0000 (09:07 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 16 Sep 2012 23:25:42 +0000 (00:25 +0100)
In the PL010 UART callback a comparison against the location of the
statically allocated PL010 device is done to figure out which UART
is doing the callback. This does not play well with dynamic devices
such as in device tree, so let's check the base address of the
memory resource inside the amba_device instead.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-integrator/core.c

index 5ba4bc8c0aa36fe6dfcc715103f70024a7c12b95..268eadf6d3e6c0803641262430cd76181eafc640 100644 (file)
@@ -99,11 +99,14 @@ int __init integrator_init(bool is_cp)
 static void integrator_uart_set_mctrl(struct amba_device *dev, void __iomem *base, unsigned int mctrl)
 {
        unsigned int ctrls = 0, ctrlc = 0, rts_mask, dtr_mask;
+       u32 phybase = dev->res.start;
 
-       if (dev == &uart0_device) {
+       if (phybase == INTEGRATOR_UART0_BASE) {
+               /* UART0 */
                rts_mask = 1 << 4;
                dtr_mask = 1 << 5;
        } else {
+               /* UART1 */
                rts_mask = 1 << 6;
                dtr_mask = 1 << 7;
        }
This page took 0.025004 seconds and 5 git commands to generate.