Commit 9c1b013a authored by Florian Fainelli's avatar Florian Fainelli Committed by Ralf Baechle

MIPS: AR7: use ar7_has_high_vlynq() to determine watchdog base address

Instead of doing yet another switch/case on the chip_id, use existing
inline function to set the watchdog base address.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/1211/Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 3e1bf29f
...@@ -576,7 +576,6 @@ static int __init ar7_register_devices(void) ...@@ -576,7 +576,6 @@ static int __init ar7_register_devices(void)
{ {
void __iomem *bootcr; void __iomem *bootcr;
u32 val; u32 val;
u16 chip_id;
int res; int res;
res = ar7_register_uarts(); res = ar7_register_uarts();
...@@ -635,18 +634,10 @@ static int __init ar7_register_devices(void) ...@@ -635,18 +634,10 @@ static int __init ar7_register_devices(void)
val = readl(bootcr); val = readl(bootcr);
iounmap(bootcr); iounmap(bootcr);
if (val & AR7_WDT_HW_ENA) { if (val & AR7_WDT_HW_ENA) {
chip_id = ar7_chip_id(); if (ar7_has_high_vlynq())
switch (chip_id) {
case AR7_CHIP_7100:
case AR7_CHIP_7200:
ar7_wdt_res.start = AR7_REGS_WDT;
break;
case AR7_CHIP_7300:
ar7_wdt_res.start = UR8_REGS_WDT; ar7_wdt_res.start = UR8_REGS_WDT;
break; else
default: ar7_wdt_res.start = AR7_REGS_WDT;
break;
}
ar7_wdt_res.end = ar7_wdt_res.start + 0x20; ar7_wdt_res.end = ar7_wdt_res.start + 0x20;
res = platform_device_register(&ar7_wdt); res = platform_device_register(&ar7_wdt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment