Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ssb: Remove home-grown printk wrappers

Replace the ssb printk wrappers by standard print helpers.
Also remove SSB_SILENT. Nobody should use it anyway.

Originally submitted by Joe Perches <joe@perches.com>.
Modified to add dev_... based printks.

Signed-off-by: Michael Buesch <m@bues.ch>
Tested-by: Michael Buesch <m@bues.ch>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Michael Büsch and committed by
Kalle Valo
b8b6069c 4d77a89e

+152 -189
+1 -13
drivers/ssb/Kconfig
··· 89 89 90 90 If unsure, say N 91 91 92 - config SSB_SILENT 93 - bool "No SSB kernel messages" 94 - depends on SSB && EXPERT 95 - help 96 - This option turns off all Sonics Silicon Backplane printks. 97 - Note that you won't be able to identify problems, once 98 - messages are turned off. 99 - This might only be desired for production kernels on 100 - embedded devices to reduce the kernel size. 101 - 102 - Say N 103 - 104 92 config SSB_DEBUG 105 93 bool "SSB debugging" 106 - depends on SSB && !SSB_SILENT 94 + depends on SSB 107 95 help 108 96 This turns on additional runtime checks and debugging 109 97 messages. Turn this on for SSB troubleshooting.
+2 -2
drivers/ssb/b43_pci_bridge.c
··· 10 10 * Licensed under the GNU/GPL. See COPYING for details. 11 11 */ 12 12 13 + #include "ssb_private.h" 14 + 13 15 #include <linux/pci.h> 14 16 #include <linux/module.h> 15 17 #include <linux/ssb/ssb.h> 16 - 17 - #include "ssb_private.h" 18 18 19 19 20 20 static const struct pci_device_id b43_pci_bridge_tbl[] = {
+3 -3
drivers/ssb/bridge_pcmcia_80211.c
··· 6 6 * Licensed under the GNU/GPL. See COPYING for details. 7 7 */ 8 8 9 + #include "ssb_private.h" 10 + 9 11 #include <linux/ssb/ssb.h> 10 12 #include <linux/slab.h> 11 13 #include <linux/module.h> ··· 16 14 #include <pcmcia/ciscode.h> 17 15 #include <pcmcia/ds.h> 18 16 #include <pcmcia/cisreg.h> 19 - 20 - #include "ssb_private.h" 21 17 22 18 static const struct pcmcia_device_id ssb_host_pcmcia_tbl[] = { 23 19 PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448), ··· 70 70 err_kfree_ssb: 71 71 kfree(ssb); 72 72 out_error: 73 - ssb_err("Initialization failed (%d, %d)\n", res, err); 73 + dev_err(&dev->dev, "Initialization failed (%d, %d)\n", res, err); 74 74 return err; 75 75 } 76 76
+3 -3
drivers/ssb/driver_chipcommon.c
··· 9 9 * Licensed under the GNU/GPL. See COPYING for details. 10 10 */ 11 11 12 + #include "ssb_private.h" 13 + 12 14 #include <linux/ssb/ssb.h> 13 15 #include <linux/ssb/ssb_regs.h> 14 16 #include <linux/export.h> 15 17 #include <linux/pci.h> 16 18 #include <linux/bcm47xx_wdt.h> 17 - 18 - #include "ssb_private.h" 19 19 20 20 21 21 /* Clock sources */ ··· 354 354 355 355 if (cc->dev->id.revision >= 11) 356 356 cc->status = chipco_read32(cc, SSB_CHIPCO_CHIPSTAT); 357 - ssb_dbg("chipcommon status is 0x%x\n", cc->status); 357 + dev_dbg(cc->dev->dev, "chipcommon status is 0x%x\n", cc->status); 358 358 359 359 if (cc->dev->id.revision >= 20) { 360 360 chipco_write32(cc, SSB_CHIPCO_GPIOPULLUP, 0);
+15 -15
drivers/ssb/driver_chipcommon_pmu.c
··· 8 8 * Licensed under the GNU/GPL. See COPYING for details. 9 9 */ 10 10 11 + #include "ssb_private.h" 12 + 11 13 #include <linux/ssb/ssb.h> 12 14 #include <linux/ssb/ssb_regs.h> 13 15 #include <linux/ssb/ssb_driver_chipcommon.h> ··· 18 16 #ifdef CONFIG_BCM47XX 19 17 #include <linux/bcm47xx_nvram.h> 20 18 #endif 21 - 22 - #include "ssb_private.h" 23 19 24 20 static u32 ssb_chipco_pll_read(struct ssb_chipcommon *cc, u32 offset) 25 21 { ··· 110 110 return; 111 111 } 112 112 113 - ssb_info("Programming PLL to %u.%03u MHz\n", 113 + dev_info(cc->dev->dev, "Programming PLL to %u.%03u MHz\n", 114 114 crystalfreq / 1000, crystalfreq % 1000); 115 115 116 116 /* First turn the PLL off. */ ··· 138 138 } 139 139 tmp = chipco_read32(cc, SSB_CHIPCO_CLKCTLST); 140 140 if (tmp & SSB_CHIPCO_CLKCTLST_HAVEHT) 141 - ssb_emerg("Failed to turn the PLL off!\n"); 141 + dev_emerg(cc->dev->dev, "Failed to turn the PLL off!\n"); 142 142 143 143 /* Set PDIV in PLL control 0. */ 144 144 pllctl = ssb_chipco_pll_read(cc, SSB_PMU0_PLLCTL0); ··· 249 249 return; 250 250 } 251 251 252 - ssb_info("Programming PLL to %u.%03u MHz\n", 252 + dev_info(cc->dev->dev, "Programming PLL to %u.%03u MHz\n", 253 253 crystalfreq / 1000, crystalfreq % 1000); 254 254 255 255 /* First turn the PLL off. */ ··· 275 275 } 276 276 tmp = chipco_read32(cc, SSB_CHIPCO_CLKCTLST); 277 277 if (tmp & SSB_CHIPCO_CLKCTLST_HAVEHT) 278 - ssb_emerg("Failed to turn the PLL off!\n"); 278 + dev_emerg(cc->dev->dev, "Failed to turn the PLL off!\n"); 279 279 280 280 /* Set p1div and p2div. */ 281 281 pllctl = ssb_chipco_pll_read(cc, SSB_PMU1_PLLCTL0); ··· 349 349 case 43222: 350 350 break; 351 351 default: 352 - ssb_err("ERROR: PLL init unknown for device %04X\n", 352 + dev_err(cc->dev->dev, "ERROR: PLL init unknown for device %04X\n", 353 353 bus->chip_id); 354 354 } 355 355 } ··· 471 471 max_msk = 0xFFFFF; 472 472 break; 473 473 default: 474 - ssb_err("ERROR: PMU resource config unknown for device %04X\n", 474 + dev_err(cc->dev->dev, "ERROR: PMU resource config unknown for device %04X\n", 475 475 bus->chip_id); 476 476 } 477 477 ··· 524 524 pmucap = chipco_read32(cc, SSB_CHIPCO_PMU_CAP); 525 525 cc->pmu.rev = (pmucap & SSB_CHIPCO_PMU_CAP_REVISION); 526 526 527 - ssb_dbg("Found rev %u PMU (capabilities 0x%08X)\n", 527 + dev_dbg(cc->dev->dev, "Found rev %u PMU (capabilities 0x%08X)\n", 528 528 cc->pmu.rev, pmucap); 529 529 530 530 if (cc->pmu.rev == 1) ··· 636 636 case 0x5354: 637 637 return ssb_pmu_get_alp_clock_clk0(cc); 638 638 default: 639 - ssb_err("ERROR: PMU alp clock unknown for device %04X\n", 639 + dev_err(cc->dev->dev, "ERROR: PMU alp clock unknown for device %04X\n", 640 640 bus->chip_id); 641 641 return 0; 642 642 } ··· 651 651 /* 5354 chip uses a non programmable PLL of frequency 240MHz */ 652 652 return 240000000; 653 653 default: 654 - ssb_err("ERROR: PMU cpu clock unknown for device %04X\n", 654 + dev_err(cc->dev->dev, "ERROR: PMU cpu clock unknown for device %04X\n", 655 655 bus->chip_id); 656 656 return 0; 657 657 } ··· 665 665 case 0x5354: 666 666 return 120000000; 667 667 default: 668 - ssb_err("ERROR: PMU controlclock unknown for device %04X\n", 668 + dev_err(cc->dev->dev, "ERROR: PMU controlclock unknown for device %04X\n", 669 669 bus->chip_id); 670 670 return 0; 671 671 } ··· 705 705 pmu_ctl = SSB_CHIPCO_PMU_CTL_PLL_UPD; 706 706 break; 707 707 default: 708 - ssb_printk(KERN_ERR PFX 709 - "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n", 710 - cc->dev->bus->chip_id); 708 + dev_err(cc->dev->dev, 709 + "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n", 710 + cc->dev->bus->chip_id); 711 711 return; 712 712 } 713 713
+3 -3
drivers/ssb/driver_chipcommon_sflash.c
··· 5 5 * Licensed under the GNU/GPL. See COPYING for details. 6 6 */ 7 7 8 - #include <linux/ssb/ssb.h> 9 - 10 8 #include "ssb_private.h" 9 + 10 + #include <linux/ssb/ssb.h> 11 11 12 12 static struct resource ssb_sflash_resource = { 13 13 .name = "ssb_sflash", ··· 80 80 return; 81 81 cpu_relax(); 82 82 } 83 - pr_err("SFLASH control command failed (timeout)!\n"); 83 + dev_err(cc->dev->dev, "SFLASH control command failed (timeout)!\n"); 84 84 } 85 85 86 86 /* Initialize serial flash access */
+2 -2
drivers/ssb/driver_extif.c
··· 10 10 * Licensed under the GNU/GPL. See COPYING for details. 11 11 */ 12 12 13 + #include "ssb_private.h" 14 + 13 15 #include <linux/serial.h> 14 16 #include <linux/serial_core.h> 15 17 #include <linux/serial_reg.h> 16 - 17 - #include "ssb_private.h" 18 18 19 19 20 20 static inline u32 extif_read32(struct ssb_extif *extif, u16 offset)
+2 -2
drivers/ssb/driver_gpio.c
··· 8 8 * Licensed under the GNU/GPL. See COPYING for details. 9 9 */ 10 10 11 + #include "ssb_private.h" 12 + 11 13 #include <linux/gpio/driver.h> 12 14 #include <linux/irq.h> 13 15 #include <linux/interrupt.h> 14 16 #include <linux/irqdomain.h> 15 17 #include <linux/export.h> 16 18 #include <linux/ssb/ssb.h> 17 - 18 - #include "ssb_private.h" 19 19 20 20 21 21 /**************************************************
+9 -8
drivers/ssb/driver_mipscore.c
··· 8 8 * Licensed under the GNU/GPL. See COPYING for details. 9 9 */ 10 10 11 + #include "ssb_private.h" 12 + 11 13 #include <linux/ssb/ssb.h> 12 14 13 15 #include <linux/mtd/physmap.h> ··· 20 18 #ifdef CONFIG_BCM47XX 21 19 #include <linux/bcm47xx_nvram.h> 22 20 #endif 23 - 24 - #include "ssb_private.h" 25 21 26 22 static const char * const part_probes[] = { "bcm47xxpart", NULL }; 27 23 ··· 170 170 irqflag |= (ipsflag & ~ipsflag_irq_mask[irq]); 171 171 ssb_write32(mdev, SSB_IPSFLAG, irqflag); 172 172 } 173 - ssb_dbg("set_irq: core 0x%04x, irq %d => %d\n", 173 + dev_dbg(dev->dev, "set_irq: core 0x%04x, irq %d => %d\n", 174 174 dev->id.coreid, oldirq+2, irq+2); 175 175 } 176 176 177 177 static void print_irq(struct ssb_device *dev, unsigned int irq) 178 178 { 179 179 static const char *irq_name[] = {"2(S)", "3", "4", "5", "6", "D", "I"}; 180 - ssb_dbg("core 0x%04x, irq : %s%s %s%s %s%s %s%s %s%s %s%s %s%s\n", 180 + dev_dbg(dev->dev, 181 + "core 0x%04x, irq : %s%s %s%s %s%s %s%s %s%s %s%s %s%s\n", 181 182 dev->id.coreid, 182 183 irq_name[0], irq == 0 ? "*" : " ", 183 184 irq_name[1], irq == 1 ? "*" : " ", ··· 230 229 switch (bus->chipco.capabilities & SSB_CHIPCO_CAP_FLASHT) { 231 230 case SSB_CHIPCO_FLASHT_STSER: 232 231 case SSB_CHIPCO_FLASHT_ATSER: 233 - pr_debug("Found serial flash\n"); 232 + dev_dbg(mcore->dev->dev, "Found serial flash\n"); 234 233 ssb_sflash_init(&bus->chipco); 235 234 break; 236 235 case SSB_CHIPCO_FLASHT_PARA: 237 - pr_debug("Found parallel flash\n"); 236 + dev_dbg(mcore->dev->dev, "Found parallel flash\n"); 238 237 pflash->present = true; 239 238 pflash->window = SSB_FLASH2; 240 239 pflash->window_size = SSB_FLASH2_SZ; ··· 300 299 if (!mcore->dev) 301 300 return; /* We don't have a MIPS core */ 302 301 303 - ssb_dbg("Initializing MIPS core...\n"); 302 + dev_dbg(mcore->dev->dev, "Initializing MIPS core...\n"); 304 303 305 304 bus = mcore->dev->bus; 306 305 hz = ssb_clockspeed(bus); ··· 348 347 break; 349 348 } 350 349 } 351 - ssb_dbg("after irq reconfiguration\n"); 350 + dev_dbg(mcore->dev->dev, "after irq reconfiguration\n"); 352 351 dump_irq(bus); 353 352 354 353 ssb_mips_serial_init(mcore);
+9 -8
drivers/ssb/driver_pcicore.c
··· 8 8 * Licensed under the GNU/GPL. See COPYING for details. 9 9 */ 10 10 11 + #include "ssb_private.h" 12 + 11 13 #include <linux/ssb/ssb.h> 12 14 #include <linux/pci.h> 13 15 #include <linux/export.h> 14 16 #include <linux/delay.h> 15 17 #include <linux/ssb/ssb_embedded.h> 16 - 17 - #include "ssb_private.h" 18 18 19 19 static u32 ssb_pcie_read(struct ssb_pcicore *pc, u32 address); 20 20 static void ssb_pcie_write(struct ssb_pcicore *pc, u32 address, u32 data); ··· 263 263 return -ENODEV; 264 264 } 265 265 266 - ssb_info("PCI: Fixing up device %s\n", pci_name(d)); 266 + dev_info(&d->dev, "PCI: Fixing up device %s\n", pci_name(d)); 267 267 268 268 /* Fix up interrupt lines */ 269 269 d->irq = ssb_mips_irq(extpci_core->dev) + 2; ··· 284 284 if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) != 0) 285 285 return; 286 286 287 - ssb_info("PCI: Fixing up bridge %s\n", pci_name(dev)); 287 + dev_info(&dev->dev, "PCI: Fixing up bridge %s\n", pci_name(dev)); 288 288 289 289 /* Enable PCI bridge bus mastering and memory space */ 290 290 pci_set_master(dev); 291 291 if (pcibios_enable_device(dev, ~0) < 0) { 292 - ssb_err("PCI: SSB bridge enable failed\n"); 292 + dev_err(&dev->dev, "PCI: SSB bridge enable failed\n"); 293 293 return; 294 294 } 295 295 ··· 298 298 299 299 /* Make sure our latency is high enough to handle the devices behind us */ 300 300 lat = 168; 301 - ssb_info("PCI: Fixing latency timer of device %s to %u\n", 301 + dev_info(&dev->dev, 302 + "PCI: Fixing latency timer of device %s to %u\n", 302 303 pci_name(dev), lat); 303 304 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); 304 305 } ··· 323 322 return; 324 323 extpci_core = pc; 325 324 326 - ssb_dbg("PCIcore in host mode found\n"); 325 + dev_dbg(pc->dev->dev, "PCIcore in host mode found\n"); 327 326 /* Reset devices on the external PCI bus */ 328 327 val = SSB_PCICORE_CTL_RST_OE; 329 328 val |= SSB_PCICORE_CTL_CLK_OE; ··· 338 337 udelay(1); /* Assertion time demanded by the PCI standard */ 339 338 340 339 if (pc->dev->bus->has_cardbus_slot) { 341 - ssb_dbg("CardBus slot detected\n"); 340 + dev_dbg(pc->dev->dev, "CardBus slot detected\n"); 342 341 pc->cardbusmode = 1; 343 342 /* GPIO 1 resets the bridge */ 344 343 ssb_gpio_out(pc->dev->bus, 1, 1);
+4 -4
drivers/ssb/embedded.c
··· 9 9 * Licensed under the GNU/GPL. See COPYING for details. 10 10 */ 11 11 12 + #include "ssb_private.h" 13 + 12 14 #include <linux/export.h> 13 15 #include <linux/platform_device.h> 14 16 #include <linux/ssb/ssb.h> ··· 18 16 #include <linux/ssb/ssb_driver_pci.h> 19 17 #include <linux/ssb/ssb_driver_gige.h> 20 18 #include <linux/pci.h> 21 - 22 - #include "ssb_private.h" 23 19 24 20 25 21 int ssb_watchdog_timer_set(struct ssb_bus *bus, u32 ticks) ··· 57 57 bus->busnumber, &wdt, 58 58 sizeof(wdt)); 59 59 if (IS_ERR(pdev)) { 60 - ssb_dbg("can not register watchdog device, err: %li\n", 61 - PTR_ERR(pdev)); 60 + pr_debug("can not register watchdog device, err: %li\n", 61 + PTR_ERR(pdev)); 62 62 return PTR_ERR(pdev); 63 63 } 64 64
+2 -2
drivers/ssb/host_soc.c
··· 8 8 * Licensed under the GNU/GPL. See COPYING for details. 9 9 */ 10 10 11 + #include "ssb_private.h" 12 + 11 13 #include <linux/bcm47xx_nvram.h> 12 14 #include <linux/ssb/ssb.h> 13 - 14 - #include "ssb_private.h" 15 15 16 16 static u8 ssb_host_soc_read8(struct ssb_device *dev, u16 offset) 17 17 {
+25 -20
drivers/ssb/main.c
··· 256 256 257 257 err = sdrv->probe(sdev, &sdev->id); 258 258 if (err) { 259 - ssb_err("Failed to thaw device %s\n", 259 + dev_err(sdev->dev, 260 + "Failed to thaw device %s\n", 260 261 dev_name(sdev->dev)); 261 262 result = err; 262 263 } ··· 432 431 433 432 err = ssb_gpio_unregister(bus); 434 433 if (err == -EBUSY) 435 - ssb_dbg("Some GPIOs are still in use\n"); 434 + pr_debug("Some GPIOs are still in use\n"); 436 435 else if (err) 437 - ssb_dbg("Can not unregister GPIO driver: %i\n", err); 436 + pr_debug("Can not unregister GPIO driver: %i\n", err); 438 437 439 438 ssb_buses_lock(); 440 439 ssb_devices_unregister(bus); ··· 519 518 sdev->dev = dev; 520 519 err = device_register(dev); 521 520 if (err) { 522 - ssb_err("Could not register %s\n", dev_name(dev)); 521 + pr_err("Could not register %s\n", dev_name(dev)); 523 522 /* Set dev to NULL to not unregister 524 523 * dev on error unwinding. */ 525 524 sdev->dev = NULL; ··· 577 576 578 577 err = ssb_gpio_init(bus); 579 578 if (err == -ENOTSUPP) 580 - ssb_dbg("GPIO driver not activated\n"); 579 + pr_debug("GPIO driver not activated\n"); 581 580 else if (err) 582 - ssb_dbg("Error registering GPIO driver: %i\n", err); 581 + pr_debug("Error registering GPIO driver: %i\n", err); 583 582 584 583 ssb_bus_may_powerdown(bus); 585 584 ··· 708 707 709 708 err = ssb_bus_register(bus, ssb_pci_get_invariants, 0); 710 709 if (!err) { 711 - ssb_info("Sonics Silicon Backplane found on PCI device %s\n", 710 + dev_info(&host_pci->dev, 711 + "Sonics Silicon Backplane found on PCI device %s\n", 712 712 dev_name(&host_pci->dev)); 713 713 } else { 714 - ssb_err("Failed to register PCI version of SSB with error %d\n", 714 + dev_err(&host_pci->dev, 715 + "Failed to register PCI version of SSB with error %d\n", 715 716 err); 716 717 } 717 718 ··· 734 731 735 732 err = ssb_bus_register(bus, ssb_pcmcia_get_invariants, baseaddr); 736 733 if (!err) { 737 - ssb_info("Sonics Silicon Backplane found on PCMCIA device %s\n", 734 + dev_info(&pcmcia_dev->dev, 735 + "Sonics Silicon Backplane found on PCMCIA device %s\n", 738 736 pcmcia_dev->devname); 739 737 } 740 738 ··· 756 752 757 753 err = ssb_bus_register(bus, ssb_sdio_get_invariants, ~0); 758 754 if (!err) { 759 - ssb_info("Sonics Silicon Backplane found on SDIO device %s\n", 755 + dev_info(&func->dev, 756 + "Sonics Silicon Backplane found on SDIO device %s\n", 760 757 sdio_func_id(func)); 761 758 } 762 759 ··· 776 771 777 772 err = ssb_bus_register(bus, ssb_host_soc_get_invariants, baseaddr); 778 773 if (!err) { 779 - ssb_info("Sonics Silicon Backplane found at address 0x%08lX\n", 780 - baseaddr); 774 + pr_info("Sonics Silicon Backplane found at address 0x%08lX\n", 775 + baseaddr); 781 776 } 782 777 783 778 return err; ··· 1062 1057 } 1063 1058 udelay(10); 1064 1059 } 1065 - printk(KERN_ERR PFX "Timeout waiting for bitmask %08X on " 1066 - "register %04X to %s.\n", 1067 - bitmask, reg, (set ? "set" : "clear")); 1060 + dev_err(dev->dev, 1061 + "Timeout waiting for bitmask %08X on register %04X to %s\n", 1062 + bitmask, reg, set ? "set" : "clear"); 1068 1063 1069 1064 return -ETIMEDOUT; 1070 1065 } ··· 1174 1169 #endif 1175 1170 return err; 1176 1171 error: 1177 - ssb_err("Bus powerdown failed\n"); 1172 + pr_err("Bus powerdown failed\n"); 1178 1173 goto out; 1179 1174 } 1180 1175 EXPORT_SYMBOL(ssb_bus_may_powerdown); ··· 1197 1192 1198 1193 return 0; 1199 1194 error: 1200 - ssb_err("Bus powerup failed\n"); 1195 + pr_err("Bus powerup failed\n"); 1201 1196 return err; 1202 1197 } 1203 1198 EXPORT_SYMBOL(ssb_bus_powerup); ··· 1305 1300 1306 1301 err = b43_pci_ssb_bridge_init(); 1307 1302 if (err) { 1308 - ssb_err("Broadcom 43xx PCI-SSB-bridge initialization failed\n"); 1303 + pr_err("Broadcom 43xx PCI-SSB-bridge initialization failed\n"); 1309 1304 /* don't fail SSB init because of this */ 1310 1305 err = 0; 1311 1306 } 1312 1307 err = ssb_host_pcmcia_init(); 1313 1308 if (err) { 1314 - ssb_err("PCMCIA host initialization failed\n"); 1309 + pr_err("PCMCIA host initialization failed\n"); 1315 1310 /* don't fail SSB init because of this */ 1316 1311 err = 0; 1317 1312 } 1318 1313 err = ssb_gige_init(); 1319 1314 if (err) { 1320 - ssb_err("SSB Broadcom Gigabit Ethernet driver initialization failed\n"); 1315 + pr_err("SSB Broadcom Gigabit Ethernet driver initialization failed\n"); 1321 1316 /* don't fail SSB init because of this */ 1322 1317 err = 0; 1323 1318 }
+27 -29
drivers/ssb/pci.c
··· 15 15 * Licensed under the GNU/GPL. See COPYING for details. 16 16 */ 17 17 18 + #include "ssb_private.h" 19 + 18 20 #include <linux/ssb/ssb.h> 19 21 #include <linux/ssb/ssb_regs.h> 20 22 #include <linux/slab.h> 21 23 #include <linux/pci.h> 22 24 #include <linux/delay.h> 23 - 24 - #include "ssb_private.h" 25 25 26 26 27 27 /* Define the following to 1 to enable a printk on each coreswitch. */ ··· 56 56 } 57 57 return 0; 58 58 error: 59 - ssb_err("Failed to switch to core %u\n", coreidx); 59 + pr_err("Failed to switch to core %u\n", coreidx); 60 60 return -ENODEV; 61 61 } 62 62 ··· 67 67 unsigned long flags; 68 68 69 69 #if SSB_VERBOSE_PCICORESWITCH_DEBUG 70 - ssb_info("Switching to %s core, index %d\n", 71 - ssb_core_name(dev->id.coreid), 72 - dev->core_index); 70 + pr_info("Switching to %s core, index %d\n", 71 + ssb_core_name(dev->id.coreid), dev->core_index); 73 72 #endif 74 73 75 74 spin_lock_irqsave(&bus->bar_lock, flags); ··· 160 161 return err; 161 162 162 163 err_pci: 163 - printk(KERN_ERR PFX "Error: ssb_pci_xtal() could not access PCI config space!\n"); 164 + pr_err("Error: ssb_pci_xtal() could not access PCI config space!\n"); 164 165 err = -EBUSY; 165 166 goto out; 166 167 } ··· 285 286 u32 spromctl; 286 287 u16 size = bus->sprom_size; 287 288 288 - ssb_notice("Writing SPROM. Do NOT turn off the power! Please stand by...\n"); 289 + pr_notice("Writing SPROM. Do NOT turn off the power! Please stand by...\n"); 289 290 err = pci_read_config_dword(pdev, SSB_SPROMCTL, &spromctl); 290 291 if (err) 291 292 goto err_ctlreg; ··· 293 294 err = pci_write_config_dword(pdev, SSB_SPROMCTL, spromctl); 294 295 if (err) 295 296 goto err_ctlreg; 296 - ssb_notice("[ 0%%"); 297 + pr_notice("[ 0%%"); 297 298 msleep(500); 298 299 for (i = 0; i < size; i++) { 299 300 if (i == size / 4) 300 - ssb_cont("25%%"); 301 + pr_cont("25%%"); 301 302 else if (i == size / 2) 302 - ssb_cont("50%%"); 303 + pr_cont("50%%"); 303 304 else if (i == (size * 3) / 4) 304 - ssb_cont("75%%"); 305 + pr_cont("75%%"); 305 306 else if (i % 2) 306 - ssb_cont("."); 307 + pr_cont("."); 307 308 writew(sprom[i], bus->mmio + bus->sprom_offset + (i * 2)); 308 309 mmiowb(); 309 310 msleep(20); ··· 316 317 if (err) 317 318 goto err_ctlreg; 318 319 msleep(500); 319 - ssb_cont("100%% ]\n"); 320 - ssb_notice("SPROM written\n"); 320 + pr_cont("100%% ]\n"); 321 + pr_notice("SPROM written\n"); 321 322 322 323 return 0; 323 324 err_ctlreg: 324 - ssb_err("Could not access SPROM control register.\n"); 325 + pr_err("Could not access SPROM control register.\n"); 325 326 return err; 326 327 } 327 328 ··· 815 816 memset(out, 0, sizeof(*out)); 816 817 817 818 out->revision = in[size - 1] & 0x00FF; 818 - ssb_dbg("SPROM revision %d detected\n", out->revision); 819 + pr_debug("SPROM revision %d detected\n", out->revision); 819 820 memset(out->et0mac, 0xFF, 6); /* preset et0 and et1 mac */ 820 821 memset(out->et1mac, 0xFF, 6); 821 822 ··· 824 825 * number stored in the SPROM. 825 826 * Always extract r1. */ 826 827 out->revision = 1; 827 - ssb_dbg("SPROM treated as revision %d\n", out->revision); 828 + pr_debug("SPROM treated as revision %d\n", out->revision); 828 829 } 829 830 830 831 switch (out->revision) { ··· 841 842 sprom_extract_r8(out, in); 842 843 break; 843 844 default: 844 - ssb_warn("Unsupported SPROM revision %d detected. Will extract v1\n", 845 - out->revision); 845 + pr_warn("Unsupported SPROM revision %d detected. Will extract v1\n", 846 + out->revision); 846 847 out->revision = 1; 847 848 sprom_extract_r123(out, in); 848 849 } ··· 862 863 u16 *buf; 863 864 864 865 if (!ssb_is_sprom_available(bus)) { 865 - ssb_err("No SPROM available!\n"); 866 + pr_err("No SPROM available!\n"); 866 867 return -ENODEV; 867 868 } 868 869 if (bus->chipco.dev) { /* can be unavailable! */ ··· 881 882 } else { 882 883 bus->sprom_offset = SSB_SPROM_BASE1; 883 884 } 884 - ssb_dbg("SPROM offset is 0x%x\n", bus->sprom_offset); 885 + pr_debug("SPROM offset is 0x%x\n", bus->sprom_offset); 885 886 886 887 buf = kcalloc(SSB_SPROMSIZE_WORDS_R123, sizeof(u16), GFP_KERNEL); 887 888 if (!buf) ··· 906 907 * available for this device in some other storage */ 907 908 err = ssb_fill_sprom_with_fallback(bus, sprom); 908 909 if (err) { 909 - ssb_warn("WARNING: Using fallback SPROM failed (err %d)\n", 910 - err); 910 + pr_warn("WARNING: Using fallback SPROM failed (err %d)\n", 911 + err); 911 912 goto out_free; 912 913 } else { 913 - ssb_dbg("Using SPROM revision %d provided by platform\n", 914 - sprom->revision); 914 + pr_debug("Using SPROM revision %d provided by platform\n", 915 + sprom->revision); 915 916 err = 0; 916 917 goto out_free; 917 918 } 918 - ssb_warn("WARNING: Invalid SPROM CRC (corrupt SPROM)\n"); 919 + pr_warn("WARNING: Invalid SPROM CRC (corrupt SPROM)\n"); 919 920 } 920 921 } 921 922 err = sprom_extract(bus, sprom, buf, bus->sprom_size); ··· 952 953 if (likely(bus->powered_up)) 953 954 return 0; 954 955 955 - printk(KERN_ERR PFX "FATAL ERROR: Bus powered down " 956 - "while accessing PCI MMIO space\n"); 956 + pr_err("FATAL ERROR: Bus powered down while accessing PCI MMIO space\n"); 957 957 if (bus->power_warn_count <= 10) { 958 958 bus->power_warn_count++; 959 959 dump_stack();
+22 -26
drivers/ssb/pcmcia.c
··· 8 8 * Licensed under the GNU/GPL. See COPYING for details. 9 9 */ 10 10 11 + #include "ssb_private.h" 12 + 11 13 #include <linux/ssb/ssb.h> 12 14 #include <linux/delay.h> 13 15 #include <linux/io.h> ··· 19 17 #include <pcmcia/ciscode.h> 20 18 #include <pcmcia/ds.h> 21 19 #include <pcmcia/cisreg.h> 22 - 23 - #include "ssb_private.h" 24 20 25 21 26 22 /* Define the following to 1 to enable a printk on each coreswitch. */ ··· 143 143 144 144 return 0; 145 145 error: 146 - ssb_err("Failed to switch to core %u\n", coreidx); 146 + pr_err("Failed to switch to core %u\n", coreidx); 147 147 return err; 148 148 } 149 149 ··· 152 152 int err; 153 153 154 154 #if SSB_VERBOSE_PCMCIACORESWITCH_DEBUG 155 - ssb_info("Switching to %s core, index %d\n", 156 - ssb_core_name(dev->id.coreid), 157 - dev->core_index); 155 + pr_info("Switching to %s core, index %d\n", 156 + ssb_core_name(dev->id.coreid), dev->core_index); 158 157 #endif 159 158 160 159 err = ssb_pcmcia_switch_coreidx(bus, dev->core_index); ··· 189 190 190 191 return 0; 191 192 error: 192 - ssb_err("Failed to switch pcmcia segment\n"); 193 + pr_err("Failed to switch pcmcia segment\n"); 193 194 return err; 194 195 } 195 196 ··· 546 547 bool failed = 0; 547 548 size_t size = SSB_PCMCIA_SPROM_SIZE; 548 549 549 - ssb_notice("Writing SPROM. Do NOT turn off the power! Please stand by...\n"); 550 + pr_notice("Writing SPROM. Do NOT turn off the power! Please stand by...\n"); 550 551 err = ssb_pcmcia_sprom_command(bus, SSB_PCMCIA_SPROMCTL_WRITEEN); 551 552 if (err) { 552 - ssb_notice("Could not enable SPROM write access\n"); 553 + pr_notice("Could not enable SPROM write access\n"); 553 554 return -EBUSY; 554 555 } 555 - ssb_notice("[ 0%%"); 556 + pr_notice("[ 0%%"); 556 557 msleep(500); 557 558 for (i = 0; i < size; i++) { 558 559 if (i == size / 4) 559 - ssb_cont("25%%"); 560 + pr_cont("25%%"); 560 561 else if (i == size / 2) 561 - ssb_cont("50%%"); 562 + pr_cont("50%%"); 562 563 else if (i == (size * 3) / 4) 563 - ssb_cont("75%%"); 564 + pr_cont("75%%"); 564 565 else if (i % 2) 565 - ssb_cont("."); 566 + pr_cont("."); 566 567 err = ssb_pcmcia_sprom_write(bus, i, sprom[i]); 567 568 if (err) { 568 - ssb_notice("Failed to write to SPROM\n"); 569 + pr_notice("Failed to write to SPROM\n"); 569 570 failed = 1; 570 571 break; 571 572 } 572 573 } 573 574 err = ssb_pcmcia_sprom_command(bus, SSB_PCMCIA_SPROMCTL_WRITEDIS); 574 575 if (err) { 575 - ssb_notice("Could not disable SPROM write access\n"); 576 + pr_notice("Could not disable SPROM write access\n"); 576 577 failed = 1; 577 578 } 578 579 msleep(500); 579 580 if (!failed) { 580 - ssb_cont("100%% ]\n"); 581 - ssb_notice("SPROM written\n"); 581 + pr_cont("100%% ]\n"); 582 + pr_notice("SPROM written\n"); 582 583 } 583 584 584 585 return failed ? -EBUSY : 0; ··· 692 693 return -ENOSPC; /* continue with next entry */ 693 694 694 695 error: 695 - ssb_err( 696 - "PCMCIA: Failed to fetch device invariants: %s\n", 697 - error_description); 696 + pr_err("PCMCIA: Failed to fetch device invariants: %s\n", 697 + error_description); 698 698 return -ENODEV; 699 699 } 700 700 ··· 713 715 res = pcmcia_loop_tuple(bus->host_pcmcia, CISTPL_FUNCE, 714 716 ssb_pcmcia_get_mac, sprom); 715 717 if (res != 0) { 716 - ssb_err( 717 - "PCMCIA: Failed to fetch MAC address\n"); 718 + pr_err("PCMCIA: Failed to fetch MAC address\n"); 718 719 return -ENODEV; 719 720 } 720 721 ··· 723 726 if ((res == 0) || (res == -ENOSPC)) 724 727 return 0; 725 728 726 - ssb_err( 727 - "PCMCIA: Failed to fetch device invariants\n"); 729 + pr_err("PCMCIA: Failed to fetch device invariants\n"); 728 730 return -ENODEV; 729 731 } 730 732 ··· 832 836 833 837 return 0; 834 838 error: 835 - ssb_err("Failed to initialize PCMCIA host device\n"); 839 + pr_err("Failed to initialize PCMCIA host device\n"); 836 840 return err; 837 841 }
+16 -18
drivers/ssb/scan.c
··· 12 12 * Licensed under the GNU/GPL. See COPYING for details. 13 13 */ 14 14 15 + #include "ssb_private.h" 16 + 15 17 #include <linux/ssb/ssb.h> 16 18 #include <linux/ssb/ssb_regs.h> 17 19 #include <linux/pci.h> ··· 21 19 22 20 #include <pcmcia/cistpl.h> 23 21 #include <pcmcia/ds.h> 24 - 25 - #include "ssb_private.h" 26 22 27 23 28 24 const char *ssb_core_name(u16 coreid) ··· 125 125 chipid_fallback = 0x4401; 126 126 break; 127 127 default: 128 - ssb_err("PCI-ID not in fallback list\n"); 128 + dev_err(&pci_dev->dev, "PCI-ID not in fallback list\n"); 129 129 } 130 130 131 131 return chipid_fallback; ··· 151 151 case 0x4704: 152 152 return 9; 153 153 default: 154 - ssb_err("CHIPID not in nrcores fallback list\n"); 154 + pr_err("CHIPID not in nrcores fallback list\n"); 155 155 } 156 156 157 157 return 1; ··· 318 318 bus->chip_package = 0; 319 319 } 320 320 } 321 - ssb_info("Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n", 322 - bus->chip_id, bus->chip_rev, bus->chip_package); 321 + pr_info("Found chip with id 0x%04X, rev 0x%02X and package 0x%02X\n", 322 + bus->chip_id, bus->chip_rev, bus->chip_package); 323 323 if (!bus->nr_devices) 324 324 bus->nr_devices = chipid_to_nrcores(bus->chip_id); 325 325 if (bus->nr_devices > ARRAY_SIZE(bus->devices)) { 326 - ssb_err("More than %d ssb cores found (%d)\n", 327 - SSB_MAX_NR_CORES, bus->nr_devices); 326 + pr_err("More than %d ssb cores found (%d)\n", 327 + SSB_MAX_NR_CORES, bus->nr_devices); 328 328 goto err_unmap; 329 329 } 330 330 if (bus->bustype == SSB_BUSTYPE_SSB) { ··· 355 355 dev->bus = bus; 356 356 dev->ops = bus->ops; 357 357 358 - printk(KERN_DEBUG PFX 359 - "Core %d found: %s " 360 - "(cc 0x%03X, rev 0x%02X, vendor 0x%04X)\n", 361 - i, ssb_core_name(dev->id.coreid), 362 - dev->id.coreid, dev->id.revision, dev->id.vendor); 358 + pr_debug("Core %d found: %s (cc 0x%03X, rev 0x%02X, vendor 0x%04X)\n", 359 + i, ssb_core_name(dev->id.coreid), 360 + dev->id.coreid, dev->id.revision, dev->id.vendor); 363 361 364 362 switch (dev->id.coreid) { 365 363 case SSB_DEV_80211: 366 364 nr_80211_cores++; 367 365 if (nr_80211_cores > 1) { 368 366 if (!we_support_multiple_80211_cores(bus)) { 369 - ssb_dbg("Ignoring additional 802.11 core\n"); 367 + pr_debug("Ignoring additional 802.11 core\n"); 370 368 continue; 371 369 } 372 370 } ··· 372 374 case SSB_DEV_EXTIF: 373 375 #ifdef CONFIG_SSB_DRIVER_EXTIF 374 376 if (bus->extif.dev) { 375 - ssb_warn("WARNING: Multiple EXTIFs found\n"); 377 + pr_warn("WARNING: Multiple EXTIFs found\n"); 376 378 break; 377 379 } 378 380 bus->extif.dev = dev; ··· 380 382 break; 381 383 case SSB_DEV_CHIPCOMMON: 382 384 if (bus->chipco.dev) { 383 - ssb_warn("WARNING: Multiple ChipCommon found\n"); 385 + pr_warn("WARNING: Multiple ChipCommon found\n"); 384 386 break; 385 387 } 386 388 bus->chipco.dev = dev; ··· 389 391 case SSB_DEV_MIPS_3302: 390 392 #ifdef CONFIG_SSB_DRIVER_MIPS 391 393 if (bus->mipscore.dev) { 392 - ssb_warn("WARNING: Multiple MIPS cores found\n"); 394 + pr_warn("WARNING: Multiple MIPS cores found\n"); 393 395 break; 394 396 } 395 397 bus->mipscore.dev = dev; ··· 410 412 } 411 413 } 412 414 if (bus->pcicore.dev) { 413 - ssb_warn("WARNING: Multiple PCI(E) cores found\n"); 415 + pr_warn("WARNING: Multiple PCI(E) cores found\n"); 414 416 break; 415 417 } 416 418 bus->pcicore.dev = dev;
+2 -2
drivers/ssb/sdio.c
··· 12 12 * 13 13 */ 14 14 15 + #include "ssb_private.h" 16 + 15 17 #include <linux/ssb/ssb.h> 16 18 #include <linux/delay.h> 17 19 #include <linux/io.h> 18 20 #include <linux/etherdevice.h> 19 21 #include <linux/mmc/sdio_func.h> 20 - 21 - #include "ssb_private.h" 22 22 23 23 /* Define the following to 1 to enable a printk on each coreswitch. */ 24 24 #define SSB_VERBOSE_SDIOCORESWITCH_DEBUG 0
+2 -2
drivers/ssb/sprom.c
··· 127 127 goto out_kfree; 128 128 err = ssb_devices_freeze(bus, &freeze); 129 129 if (err) { 130 - ssb_err("SPROM write: Could not freeze all devices\n"); 130 + pr_err("SPROM write: Could not freeze all devices\n"); 131 131 goto out_unlock; 132 132 } 133 133 res = sprom_write(bus, sprom); 134 134 err = ssb_devices_thaw(&freeze); 135 135 if (err) 136 - ssb_err("SPROM write: Could not thaw all devices\n"); 136 + pr_err("SPROM write: Could not thaw all devices\n"); 137 137 out_unlock: 138 138 mutex_unlock(&bus->sprom_mutex); 139 139 out_kfree:
+3 -27
drivers/ssb/ssb_private.h
··· 2 2 #ifndef LINUX_SSB_PRIVATE_H_ 3 3 #define LINUX_SSB_PRIVATE_H_ 4 4 5 + #define PFX "ssb: " 6 + #define pr_fmt(fmt) PFX fmt 7 + 5 8 #include <linux/ssb/ssb.h> 6 9 #include <linux/types.h> 7 10 #include <linux/bcm47xx_wdt.h> 8 - 9 - 10 - #define PFX "ssb: " 11 - 12 - #ifdef CONFIG_SSB_SILENT 13 - # define ssb_printk(fmt, ...) \ 14 - do { if (0) printk(fmt, ##__VA_ARGS__); } while (0) 15 - #else 16 - # define ssb_printk(fmt, ...) \ 17 - printk(fmt, ##__VA_ARGS__) 18 - #endif /* CONFIG_SSB_SILENT */ 19 - 20 - #define ssb_emerg(fmt, ...) ssb_printk(KERN_EMERG PFX fmt, ##__VA_ARGS__) 21 - #define ssb_err(fmt, ...) ssb_printk(KERN_ERR PFX fmt, ##__VA_ARGS__) 22 - #define ssb_warn(fmt, ...) ssb_printk(KERN_WARNING PFX fmt, ##__VA_ARGS__) 23 - #define ssb_notice(fmt, ...) ssb_printk(KERN_NOTICE PFX fmt, ##__VA_ARGS__) 24 - #define ssb_info(fmt, ...) ssb_printk(KERN_INFO PFX fmt, ##__VA_ARGS__) 25 - #define ssb_cont(fmt, ...) ssb_printk(KERN_CONT fmt, ##__VA_ARGS__) 26 - 27 - /* dprintk: Debugging printk; vanishes for non-debug compilation */ 28 - #ifdef CONFIG_SSB_DEBUG 29 - # define ssb_dbg(fmt, ...) \ 30 - ssb_printk(KERN_DEBUG PFX fmt, ##__VA_ARGS__) 31 - #else 32 - # define ssb_dbg(fmt, ...) \ 33 - do { if (0) printk(KERN_DEBUG PFX fmt, ##__VA_ARGS__); } while (0) 34 - #endif 35 11 36 12 #ifdef CONFIG_SSB_DEBUG 37 13 # define SSB_WARN_ON(x) WARN_ON(x)