atheros: various printk(...) fixes
[openwrt/svn-archive/archive.git] / target / linux / atheros / patches-3.10 / 100-board.patch
index 7192a7b1dc00da9f1474bc985aa0a695b8f638f7..4816667474ba3eb124584671e697d1717e89c1c5 100644 (file)
@@ -84,7 +84,7 @@
 +obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o
 --- /dev/null
 +++ b/arch/mips/ar231x/board.c
-@@ -0,0 +1,259 @@
+@@ -0,0 +1,260 @@
 +/*
 + * 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
 +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;
 +}
 +
 +      }
 +
 +      if (!found) {
-+              printk("Could not find Radio Configuration data\n");
++              pr_warn("WARNING: Could not find Radio Configuration data\n");
 +              radio_config = 0;
 +      }
 +
 +      }
 +
 +      if (!bcfg) {
-+              printk(KERN_WARNING "WARNING: No board configuration data found!\n");
++              pr_warn("WARNING: No board configuration data found!\n");
 +              return -ENODEV;
 +      }
 +
 +      ar231x_board.config = (struct ar231x_boarddata *) board_data;
 +      memcpy(board_data, bcfg, 0x100);
 +      if (broken_boarddata) {
-+              printk(KERN_WARNING "WARNING: broken board data detected\n");
++              pr_warn("WARNING: broken board data detected\n");
 +              config = ar231x_board.config;
 +              if (!memcmp(config->enet0_mac, "\x00\x00\x00\x00\x00\x00", 6)) {
-+                      printk(KERN_INFO "Fixing up empty mac addresses\n");
++                      pr_info("Fixing up empty mac addresses\n");
 +                      config->reset_config_gpio = 0xffff;
 +                      config->sys_led_gpio = 0xffff;
 +                      random_ether_addr(config->wlan0_mac);
 +      radio_data = board_data + 0x100 + ((rcfg - bcfg) & 0xfff);
 +      ar231x_board.radio = radio_data;
 +      offset = radio_data - board_data;
-+      printk(KERN_INFO "Radio config found at offset 0x%x(0x%x)\n", rcfg - bcfg, offset);
++      pr_info("Radio config found at offset 0x%x (0x%x)\n", rcfg - bcfg,
++              offset);
 +      rcfg_size = BOARD_CONFIG_BUFSZ - offset;
 +      memcpy(radio_data, rcfg, rcfg_size);
 +
 +      mac_addr = &radio_data[0x1d * 2];
 +      if (is_broadcast_ether_addr(mac_addr)) {
-+              printk(KERN_INFO "Radio MAC is blank; using board-data\n");
++              pr_info("Radio MAC is blank; using board-data\n");
 +              memcpy(mac_addr, ar231x_board.config->wlan0_mac, ETH_ALEN);
 +      }
 +
 +#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
 +      u32 dma1 = ar231x_read_reg(AR531X_DMA1);
 +      u32 dma_addr = ar231x_read_reg(AR531X_DMAADDR);   /* clears error */
 +
-+      printk("AHB interrupt: PROCADDR=0x%8.8x  PROC1=0x%8.8x  DMAADDR=0x%8.8x  DMA1=0x%8.8x\n",
-+             proc_addr, proc1, dma_addr, dma1);
++      pr_emerg("AHB interrupt: PROCADDR=0x%8.8x  PROC1=0x%8.8x  "
++               "DMAADDR=0x%8.8x  DMA1=0x%8.8x\n", proc_addr, proc1, dma_addr,
++               dma1);
 +
 +      machine_restart("AHB error"); /* Catastrophic failure */
 +      return IRQ_HANDLED;
 +{
 +      /* 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;
 +}
 +
 +      gpch = &ar5312_gpio_chip;
 +      ret = gpiochip_add(&gpch->chip);
 +      if (ret) {
-+              printk(KERN_ERR "%s: failed to add gpiochip\n",
-+                      gpch->chip.label);
++              pr_err("%s: failed to add gpiochip\n", gpch->chip.label);
 +              return ret;
 +      }
-+      printk(KERN_INFO "%s: registered %d GPIOs\n",
-+              gpch->chip.label, gpch->chip.ngpio);
++      pr_info("%s: registered %d GPIOs\n", gpch->chip.label,
++              gpch->chip.ngpio);
 +      return ret;
 +}
 +
 +
 --- /dev/null
 +++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,693 @@
+@@ -0,0 +1,691 @@
 +/*
 + * 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
 +    ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET);
 +    ar231x_read_reg(AR2315_AHB_ERR1);
 +
-+    printk(KERN_ERR "AHB fatal error\n");
++    pr_emerg("AHB fatal error\n");
 +    machine_restart("AHB error"); /* Catastrophic failure */
 +
 +    return IRQ_HANDLED;
 +      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;
 +      gpch = &ar2315_gpio_chip;
 +      ret = gpiochip_add(&gpch->chip);
 +      if (ret) {
-+              printk(KERN_ERR "%s: failed to add gpiochip\n",
-+                      gpch->chip.label);
++              pr_err("%s: failed to add gpiochip\n", gpch->chip.label);
 +              return ret;
 +      }
-+      printk(KERN_INFO "%s: registered %d GPIOs\n",
-+              gpch->chip.label, gpch->chip.ngpio);
++      pr_info("%s: registered %d GPIOs\n", gpch->chip.label,
++              gpch->chip.ngpio);
 +      return ret;
 +}
 +