linux-mips
[Top] [All Lists]

[PATCH 1/2] AR7: use ar7_has_high_vlynq() to determine watchdog base add

To: linux-mips@linux-mips.org
Subject: [PATCH 1/2] AR7: use ar7_has_high_vlynq() to determine watchdog base address
From: Florian Fainelli <florian@openwrt.org>
Date: Tue, 11 May 2010 11:20:09 +0200
Cc: Ralf Baechle <ralf@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:date:subject :mime-version:x-uid:x-length:organization:to:cc:content-type :content-transfer-encoding:message-id; bh=pbMVpo5rzswu2AWZFbFrR/dS6QYt5arYI0xs0PJJggg=; b=e3KtdDKBu1VAY/x4by5jhnNa4uOpgcLpIakuQMQNWCH0oMiMOKs0vbcWC+YKRr3Iga BXebz+vRknMkhKlIQxLuyvXorUl9D/5fh82s7hN8h6vEQqK5DfDR61XeIvRAbYjGhbSr SIj+u1vuUWUvo7Jrb5xuWprcFNrRFO0HAhx9I=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:date:subject:mime-version:x-uid:x-length:organization :to:cc:content-type:content-transfer-encoding:message-id; b=F4Zx5Q7n9FroVDyb4dBw1DtQyrdD/tMRImqvvr4G1bN0U2hHaDIqcUblrVqKgc2xyK ZnvrCBw/FyaGCxc9/vlVa1eKCi3jgX1keTwizihUAFkuSCKppkGV4oP+IsoSJkKA5PlA vFVJ5YdL+JhOBFr6wKcVDJfDdRPTxPfQF0sJ8=
Organization: OpenWrt
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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>
---
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index 2fafc78..1d4a466 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -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);



<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 1/2] AR7: use ar7_has_high_vlynq() to determine watchdog base address, Florian Fainelli <=