atheros: various printk(...) fixes
Use more particular functions dev_<level> or pr_<level>(...) insead of direct printk(...) call. Add KERN_LEVEL to calls what missed it. Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com> SVN-Revision: 41088
This commit is contained in:
parent
15a2ebbc38
commit
90ca9a582d
3 changed files with 33 additions and 30 deletions
|
@ -84,7 +84,7 @@
|
||||||
+obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o
|
+obj-$(CONFIG_ATHEROS_AR2315) += ar2315.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/arch/mips/ar231x/board.c
|
+++ 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
|
+ * 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
|
+ * License. See the file "COPYING" in the main directory of this archive
|
||||||
|
@ -209,7 +209,7 @@
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (!found) {
|
+ if (!found) {
|
||||||
+ printk("Could not find Radio Configuration data\n");
|
+ pr_warn("WARNING: Could not find Radio Configuration data\n");
|
||||||
+ radio_config = 0;
|
+ radio_config = 0;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -243,7 +243,7 @@
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (!bcfg) {
|
+ if (!bcfg) {
|
||||||
+ printk(KERN_WARNING "WARNING: No board configuration data found!\n");
|
+ pr_warn("WARNING: No board configuration data found!\n");
|
||||||
+ return -ENODEV;
|
+ return -ENODEV;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -251,10 +251,10 @@
|
||||||
+ ar231x_board.config = (struct ar231x_boarddata *) board_data;
|
+ ar231x_board.config = (struct ar231x_boarddata *) board_data;
|
||||||
+ memcpy(board_data, bcfg, 0x100);
|
+ memcpy(board_data, bcfg, 0x100);
|
||||||
+ if (broken_boarddata) {
|
+ if (broken_boarddata) {
|
||||||
+ printk(KERN_WARNING "WARNING: broken board data detected\n");
|
+ pr_warn("WARNING: broken board data detected\n");
|
||||||
+ config = ar231x_board.config;
|
+ config = ar231x_board.config;
|
||||||
+ if (!memcmp(config->enet0_mac, "\x00\x00\x00\x00\x00\x00", 6)) {
|
+ 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->reset_config_gpio = 0xffff;
|
||||||
+ config->sys_led_gpio = 0xffff;
|
+ config->sys_led_gpio = 0xffff;
|
||||||
+ random_ether_addr(config->wlan0_mac);
|
+ random_ether_addr(config->wlan0_mac);
|
||||||
|
@ -279,13 +279,14 @@
|
||||||
+ radio_data = board_data + 0x100 + ((rcfg - bcfg) & 0xfff);
|
+ radio_data = board_data + 0x100 + ((rcfg - bcfg) & 0xfff);
|
||||||
+ ar231x_board.radio = radio_data;
|
+ ar231x_board.radio = radio_data;
|
||||||
+ offset = radio_data - board_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;
|
+ rcfg_size = BOARD_CONFIG_BUFSZ - offset;
|
||||||
+ memcpy(radio_data, rcfg, rcfg_size);
|
+ memcpy(radio_data, rcfg, rcfg_size);
|
||||||
+
|
+
|
||||||
+ mac_addr = &radio_data[0x1d * 2];
|
+ mac_addr = &radio_data[0x1d * 2];
|
||||||
+ if (is_broadcast_ether_addr(mac_addr)) {
|
+ 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);
|
+ memcpy(mac_addr, ar231x_board.config->wlan0_mac, ETH_ALEN);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -1640,8 +1641,9 @@
|
||||||
+ u32 dma1 = ar231x_read_reg(AR531X_DMA1);
|
+ u32 dma1 = ar231x_read_reg(AR531X_DMA1);
|
||||||
+ u32 dma_addr = ar231x_read_reg(AR531X_DMAADDR); /* clears error */
|
+ 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",
|
+ pr_emerg("AHB interrupt: PROCADDR=0x%8.8x PROC1=0x%8.8x "
|
||||||
+ proc_addr, proc1, dma_addr, dma1);
|
+ "DMAADDR=0x%8.8x DMA1=0x%8.8x\n", proc_addr, proc1, dma_addr,
|
||||||
|
+ dma1);
|
||||||
+
|
+
|
||||||
+ machine_restart("AHB error"); /* Catastrophic failure */
|
+ machine_restart("AHB error"); /* Catastrophic failure */
|
||||||
+ return IRQ_HANDLED;
|
+ return IRQ_HANDLED;
|
||||||
|
@ -2057,12 +2059,11 @@
|
||||||
+ gpch = &ar5312_gpio_chip;
|
+ gpch = &ar5312_gpio_chip;
|
||||||
+ ret = gpiochip_add(&gpch->chip);
|
+ ret = gpiochip_add(&gpch->chip);
|
||||||
+ if (ret) {
|
+ if (ret) {
|
||||||
+ printk(KERN_ERR "%s: failed to add gpiochip\n",
|
+ pr_err("%s: failed to add gpiochip\n", gpch->chip.label);
|
||||||
+ gpch->chip.label);
|
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ }
|
+ }
|
||||||
+ printk(KERN_INFO "%s: registered %d GPIOs\n",
|
+ pr_info("%s: registered %d GPIOs\n", gpch->chip.label,
|
||||||
+ gpch->chip.label, gpch->chip.ngpio);
|
+ gpch->chip.ngpio);
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
@ -2108,7 +2109,7 @@
|
||||||
+
|
+
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/arch/mips/ar231x/ar2315.c
|
+++ b/arch/mips/ar231x/ar2315.c
|
||||||
@@ -0,0 +1,692 @@
|
@@ -0,0 +1,691 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This file is subject to the terms and conditions of the GNU General Public
|
+ * 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
|
+ * License. See the file "COPYING" in the main directory of this archive
|
||||||
|
@ -2322,7 +2323,7 @@
|
||||||
+ ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET);
|
+ ar231x_write_reg(AR2315_AHB_ERR0, AHB_ERROR_DET);
|
||||||
+ ar231x_read_reg(AR2315_AHB_ERR1);
|
+ 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 */
|
+ machine_restart("AHB error"); /* Catastrophic failure */
|
||||||
+
|
+
|
||||||
+ return IRQ_HANDLED;
|
+ return IRQ_HANDLED;
|
||||||
|
@ -2742,12 +2743,11 @@
|
||||||
+ gpch = &ar2315_gpio_chip;
|
+ gpch = &ar2315_gpio_chip;
|
||||||
+ ret = gpiochip_add(&gpch->chip);
|
+ ret = gpiochip_add(&gpch->chip);
|
||||||
+ if (ret) {
|
+ if (ret) {
|
||||||
+ printk(KERN_ERR "%s: failed to add gpiochip\n",
|
+ pr_err("%s: failed to add gpiochip\n", gpch->chip.label);
|
||||||
+ gpch->chip.label);
|
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+ }
|
+ }
|
||||||
+ printk(KERN_INFO "%s: registered %d GPIOs\n",
|
+ pr_info("%s: registered %d GPIOs\n", gpch->chip.label,
|
||||||
+ gpch->chip.label, gpch->chip.ngpio);
|
+ gpch->chip.ngpio);
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
|
|
@ -251,7 +251,7 @@
|
||||||
+ flash_size = FLASH_16MB;
|
+ flash_size = FLASH_16MB;
|
||||||
+ break;
|
+ break;
|
||||||
+ default:
|
+ default:
|
||||||
+ printk (KERN_WARNING SPIFLASH "Read of flash device signature failed!\n");
|
+ pr_warn(SPIFLASH "Read of flash device signature failed!\n");
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -454,19 +454,19 @@
|
||||||
+
|
+
|
||||||
+ priv->mmraddr = ioremap_nocache(SPI_FLASH_MMR, SPI_FLASH_MMR_SIZE);
|
+ priv->mmraddr = ioremap_nocache(SPI_FLASH_MMR, SPI_FLASH_MMR_SIZE);
|
||||||
+ if (!priv->mmraddr) {
|
+ if (!priv->mmraddr) {
|
||||||
+ printk(KERN_WARNING SPIFLASH "Failed to map flash device\n");
|
+ dev_warn(&pdev->dev, SPIFLASH "Failed to map flash device\n");
|
||||||
+ goto error;
|
+ goto error;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ index = spiflash_probe_chip(priv);
|
+ index = spiflash_probe_chip(priv);
|
||||||
+ if (!index) {
|
+ if (!index) {
|
||||||
+ printk (KERN_WARNING SPIFLASH "Found no serial flash device\n");
|
+ dev_warn(&pdev->dev, SPIFLASH "Found no flash device\n");
|
||||||
+ goto error;
|
+ goto error;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ priv->readaddr = ioremap_nocache(SPI_FLASH_READ, flashconfig_tbl[index].byte_cnt);
|
+ priv->readaddr = ioremap_nocache(SPI_FLASH_READ, flashconfig_tbl[index].byte_cnt);
|
||||||
+ if (!priv->readaddr) {
|
+ if (!priv->readaddr) {
|
||||||
+ printk (KERN_WARNING SPIFLASH "Failed to map flash device\n");
|
+ dev_warn(&pdev->dev, SPIFLASH "Failed to map flash device\n");
|
||||||
+ goto error;
|
+ goto error;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/watchdog/ar2315-wtd.c
|
+++ b/drivers/watchdog/ar2315-wtd.c
|
||||||
@@ -0,0 +1,197 @@
|
@@ -0,0 +1,200 @@
|
||||||
+/*
|
+/*
|
||||||
+ * This program is free software; you can redistribute it and/or modify
|
+ * 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
|
+ * it under the terms of the GNU General Public License as published by
|
||||||
|
@ -80,10 +80,12 @@
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static irqreturn_t
|
+static irqreturn_t
|
||||||
+ar2315_wdt_interrupt(int irq, void *dev_id)
|
+ar2315_wdt_interrupt(int irq, void *dev)
|
||||||
+{
|
+{
|
||||||
|
+ struct platform_device *pdev = (struct platform_device *)dev;
|
||||||
|
+
|
||||||
+ if (started) {
|
+ if (started) {
|
||||||
+ printk(KERN_CRIT "watchdog expired, rebooting system\n");
|
+ dev_crit(&pdev->dev, "watchdog expired, rebooting system\n");
|
||||||
+ emergency_restart();
|
+ emergency_restart();
|
||||||
+ } else {
|
+ } else {
|
||||||
+ ar231x_write_reg(AR2315_WDC, 0);
|
+ ar231x_write_reg(AR2315_WDC, 0);
|
||||||
|
@ -150,15 +152,16 @@
|
||||||
+ int ret = 0;
|
+ int ret = 0;
|
||||||
+
|
+
|
||||||
+ ar2315_wdt_enable();
|
+ ar2315_wdt_enable();
|
||||||
+ ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt, IRQF_DISABLED, "ar2315_wdt", NULL);
|
+ ret = request_irq(AR531X_MISC_IRQ_WATCHDOG, ar2315_wdt_interrupt,
|
||||||
|
+ IRQF_DISABLED, "ar2315_wdt", dev);
|
||||||
+ if (ret) {
|
+ if (ret) {
|
||||||
+ printk(KERN_ERR "ar2315wdt: failed to register inetrrupt\n");
|
+ dev_err(&dev->dev, "failed to register inetrrupt\n");
|
||||||
+ goto out;
|
+ goto out;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ ret = misc_register(&ar2315_wdt_miscdev);
|
+ ret = misc_register(&ar2315_wdt_miscdev);
|
||||||
+ if(ret)
|
+ if(ret)
|
||||||
+ printk(KERN_ERR "ar2315wdt: failed to register miscdev\n");
|
+ dev_err(&dev->dev, "failed to register miscdev\n");
|
||||||
+
|
+
|
||||||
+out:
|
+out:
|
||||||
+ return ret;
|
+ return ret;
|
||||||
|
@ -186,7 +189,7 @@
|
||||||
+{
|
+{
|
||||||
+ int ret = platform_driver_register(&ar2315_wdt_driver);
|
+ int ret = platform_driver_register(&ar2315_wdt_driver);
|
||||||
+ if(ret)
|
+ if(ret)
|
||||||
+ printk(KERN_INFO "ar2315_wdt: error registering platfom driver!");
|
+ pr_err("ar2315_wdt: error registering platfom driver!\n");
|
||||||
+ return ret;
|
+ return ret;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
|
Loading…
Reference in a new issue