MIPS: AR7: use ar7_has_high_vlynq() to determine watchdog base address
authorFlorian Fainelli <florian@openwrt.org>
Tue, 11 May 2010 09:20:09 +0000 (11:20 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 21 May 2010 20:31:22 +0000 (21:31 +0100)
Instead of doing yet another switch/case on the chip_id, use existing
inline function to set the watchdog base address.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/1211/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/ar7/platform.c

index 2fafc78e5ce1d408ef15c09519edef79eb70da3c..1d4a466ccb6f9c3d23f0b120c7bd375e1a612504 100644 (file)
@@ -576,7 +576,6 @@ static int __init ar7_register_devices(void)
 {
        void __iomem *bootcr;
        u32 val;
-       u16 chip_id;
        int res;
 
        res = ar7_register_uarts();
@@ -635,18 +634,10 @@ static int __init ar7_register_devices(void)
        val = readl(bootcr);
        iounmap(bootcr);
        if (val & AR7_WDT_HW_ENA) {
-               chip_id = ar7_chip_id();
-               switch (chip_id) {
-               case AR7_CHIP_7100:
-               case AR7_CHIP_7200:
-                       ar7_wdt_res.start = AR7_REGS_WDT;
-                       break;
-               case AR7_CHIP_7300:
+               if (ar7_has_high_vlynq())
                        ar7_wdt_res.start = UR8_REGS_WDT;
-                       break;
-               default:
-                       break;
-               }
+               else
+                       ar7_wdt_res.start = AR7_REGS_WDT;
 
                ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
                res = platform_device_register(&ar7_wdt);