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