+check_radio_magic(u8 *addr)
+{
+ addr += 0x7a; /* offset for flash magic */
-+ if ((addr[0] == 0x5a) && (addr[1] == 0xa5)) {
++ if ((addr[0] == 0x5a) && (addr[1] == 0xa5))
+ return 1;
-+ }
++
+ return 0;
+}
+
+#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar231x/gpio.h
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,30 @@
+#ifndef _ATHEROS_GPIO_H_
+#define _ATHEROS_GPIO_H_
+
+/* not sure if these are used? */
+
+/* Returns IRQ to attach for gpio. Unchecked function */
-+static inline int gpio_to_irq(unsigned gpio) {
++static inline int gpio_to_irq(unsigned gpio)
++{
+ return AR531X_GPIO_IRQ(gpio);
+}
+
+/* Returns gpio for IRQ attached. Unchecked function */
-+static inline int irq_to_gpio(unsigned irq) {
++static inline int irq_to_gpio(unsigned irq)
++{
+ return irq - AR531X_GPIO_IRQ(0);
+}
+
+
--- /dev/null
+++ b/arch/mips/ar231x/ar5312.c
-@@ -0,0 +1,580 @@
+@@ -0,0 +1,579 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+{
+ /* reset the system */
+ local_irq_disable();
-+ while(1) {
++ while (1)
+ ar231x_write_reg(AR531X_RESET, AR531X_RESET_SYSTEM);
-+ }
+}
+
+
+ predivisor = clockctl1_predivide_table[predivide_select];
+ multiplier = (clock_ctl1 & multiplier_mask) >> multiplier_shift;
+
-+ if (clock_ctl1 & doubler_mask) {
++ if (clock_ctl1 & doubler_mask)
+ multiplier = multiplier << 1;
-+ }
++
+ return (40000000 / predivisor) * multiplier;
+}
+
+
--- /dev/null
+++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,693 @@
+@@ -0,0 +1,692 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ int i, led = 0;
+
+ ar2315_led_data.num_leds = 0;
-+ for(i = 1; i < 8; i++)
-+ {
++ for (i = 1; i < 8; i++) {
+ if((i == AR2315_RESET_GPIO) ||
+ (i == ar231x_board.config->reset_config_gpio))
+ continue;
+obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o
--- /dev/null
+++ b/drivers/net/ethernet/ar231x/ar231x.c
-@@ -0,0 +1,1266 @@
+@@ -0,0 +1,1260 @@
+/*
+ * ar231x.c: Linux driver for the Atheros AR231x Ethernet device.
+ *
+
+ add_timer(&sp->link_timer);
+ return 0;
-+
+}
+
+static void ar231x_link_timer_fn(unsigned long data)
+ * Loop faster when we don't have link.
+ * This was needed to speed up the AP bootstrap time.
+ */
-+ if (sp->link == 0) {
++ if (sp->link == 0)
+ mod_timer(&sp->link_timer, jiffies + HZ / 2);
-+ } else {
++ else
+ mod_timer(&sp->link_timer, jiffies + LINK_TIMER);
-+ }
+}
+
+static void ar231x_check_link(struct net_device *dev)
+ */
+static void ar231x_load_rx_ring(struct net_device *dev, int nr_bufs)
+{
-+
+ struct ar231x_private *sp = netdev_priv(dev);
+ short i, idx;
+
+
+ /* process at most the entire ring and then wait for another int */
+ while (1) {
-+
+ rxdesc = &sp->rx_ring[idx];
+ status = rxdesc->status;
++
+ if (status & DMA_RX_OWN) {
+ /* SiByte owns descriptor or descr not yet filled in */
+ rval = 0;
+ /* alloc new buffer. */
+ skb_new = netdev_alloc_skb_ip_align(dev, AR2313_BUFSIZE);
+ if (skb_new != NULL) {
-+
+ skb = sp->rx_skb[idx];
+ /* set skb */
+ skb_put(skb,
+ struct net_device *dev = (struct net_device *) data;
+ struct ar231x_private *sp = netdev_priv(dev);
+
-+ if (sp->unloading) {
++ if (sp->unloading)
+ return;
-+ }
+
+ if (ar231x_rx_int(dev)) {
+ tasklet_hi_schedule(&sp->rx_tasklet);
+ }
+
+ /* abnormal status */
-+ if (status & (DMA_STATUS_FBE | DMA_STATUS_TPS)) {
++ if (status & (DMA_STATUS_FBE | DMA_STATUS_TPS))
+ ar231x_restart(dev);
-+ }
++
+ return IRQ_HANDLED;
+}
+
+ int ret;
+
+ switch (cmd) {
-+
+ case SIOCETHTOOL:
+ spin_lock_irq(&sp->lock);
+ ret = phy_ethtool_ioctl(sp->phy_dev, (void *) ifr->ifr_data);
--- /dev/null
+++ b/drivers/watchdog/ar2315-wtd.c
-@@ -0,0 +1,200 @@
+@@ -0,0 +1,197 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+static irqreturn_t
+ar2315_wdt_interrupt(int irq, void *dev_id)
+{
-+ if(started)
-+ {
++ if (started) {
+ printk(KERN_CRIT "watchdog expired, rebooting system\n");
+ emergency_restart();
+ } else {
+ int new_wdt_timeout;
+ int ret = -ENOIOCTLCMD;
+
-+ switch(cmd)
-+ {
++ switch (cmd) {
+ case WDIOC_GETSUPPORT:
+ ret = copy_to_user((struct watchdog_info __user *)arg, &ident, sizeof(ident)) ? -EFAULT : 0;
+ break;
+
+ ar2315_wdt_enable();
+ ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, IRQF_DISABLED, "ar2315_wdt", NULL);
-+ if(ret)
-+ {
++ if (ret) {
+ printk(KERN_ERR "ar2315wdt: failed to register inetrrupt\n");
+ goto out;
+ }
parts[i].size = fl->img->size;
parts[i].offset = fl->img->flash_base;
parts[i].name = names;
-@@ -284,6 +289,14 @@ static int parse_redboot_partitions(stru
+@@ -284,6 +289,13 @@ static int parse_redboot_partitions(stru
fl = fl->next;
kfree(tmp_fl);
}
-+ if(master->size - max_offset >= master->erasesize)
-+ {
++ if (master->size - max_offset >= master->erasesize) {
+ parts[nrparts].size = master->size - max_offset;
+ parts[nrparts].offset = max_offset;
+ parts[nrparts].name = names;
fl = fl->next;
kfree(tmp_fl);
}
-- if(master->size - max_offset >= master->erasesize)
+- if (master->size - max_offset >= master->erasesize) {
+
+ if (master->size - max_offset >=
-+ mtd_get_offset_erasesize(master, max_offset))
- {
++ mtd_get_offset_erasesize(master, max_offset)) {
parts[nrparts].size = master->size - max_offset;
parts[nrparts].offset = max_offset;
+ parts[nrparts].name = names;
kfree(dev);
return 0;
}
-@@ -1120,6 +1166,9 @@ static int ar231x_ioctl(struct net_devic
+@@ -1115,6 +1161,9 @@ static int ar231x_ioctl(struct net_devic
struct ar231x_private *sp = netdev_priv(dev);
int ret;
+ return -ENODEV;
+
switch (cmd) {
-
case SIOCETHTOOL:
+ spin_lock_irq(&sp->lock);
--- a/drivers/net/ethernet/ar231x/ar231x.c
+++ b/drivers/net/ethernet/ar231x/ar231x.c
-@@ -1283,7 +1283,7 @@ static int ar231x_mdiobus_probe (struct
+@@ -1277,7 +1277,7 @@ static int ar231x_mdiobus_probe (struct
BUG_ON(!phydev);
BUG_ON(phydev->attached_dev);