Skip to content

Commit 601bf18

Browse files
geertuRich Felker
authored andcommitted
sh: pci: Modernize printing of kernel messages
- Convert from printk() to pr_*(), - Add missing continuations, - Join broken messages. Note that printk(KERN_DEBUG ...) is retained, to preserve behavior (pr_debug() is a dummy if DEBUG is not defined). Signed-off-by: Geert Uytterhoeven <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Rich Felker <[email protected]>
1 parent f88c6a2 commit 601bf18

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

arch/sh/drivers/pci/common.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ int __init pci_is_66mhz_capable(struct pci_channel *hose,
5454
int cap66 = -1;
5555
u16 stat;
5656

57-
printk(KERN_INFO "PCI: Checking 66MHz capabilities...\n");
57+
pr_info("PCI: Checking 66MHz capabilities...\n");
5858

5959
for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
6060
if (PCI_FUNC(pci_devfn))
@@ -134,7 +134,7 @@ unsigned int pcibios_handle_status_errors(unsigned long addr,
134134
pcibios_report_status(PCI_STATUS_REC_TARGET_ABORT |
135135
PCI_STATUS_SIG_TARGET_ABORT |
136136
PCI_STATUS_REC_MASTER_ABORT, 1);
137-
printk("\n");
137+
pr_cont("\n");
138138

139139
cmd |= PCI_STATUS_REC_TARGET_ABORT;
140140
}
@@ -143,7 +143,7 @@ unsigned int pcibios_handle_status_errors(unsigned long addr,
143143
printk(KERN_DEBUG "PCI: parity error detected: ");
144144
pcibios_report_status(PCI_STATUS_PARITY |
145145
PCI_STATUS_DETECTED_PARITY, 1);
146-
printk("\n");
146+
pr_cont("\n");
147147

148148
cmd |= PCI_STATUS_PARITY | PCI_STATUS_DETECTED_PARITY;
149149

arch/sh/drivers/pci/pci-sh7780.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static irqreturn_t sh7780_pci_serr_irq(int irq, void *dev_id)
148148

149149
printk(KERN_DEBUG "PCI: system error received: ");
150150
pcibios_report_status(PCI_STATUS_SIG_SYSTEM_ERROR, 1);
151-
printk("\n");
151+
pr_cont("\n");
152152

153153
/* Deassert SERR */
154154
__raw_writel(SH4_PCIINTM_SDIM, hose->reg_base + SH4_PCIINTM);
@@ -179,7 +179,7 @@ static int __init sh7780_pci_setup_irqs(struct pci_channel *hose)
179179
ret = request_irq(hose->serr_irq, sh7780_pci_serr_irq, 0,
180180
"PCI SERR interrupt", hose);
181181
if (unlikely(ret)) {
182-
printk(KERN_ERR "PCI: Failed hooking SERR IRQ\n");
182+
pr_err("PCI: Failed hooking SERR IRQ\n");
183183
return ret;
184184
}
185185

@@ -250,7 +250,7 @@ static int __init sh7780_pci_init(void)
250250
const char *type;
251251
int ret, i;
252252

253-
printk(KERN_NOTICE "PCI: Starting initialization.\n");
253+
pr_notice("PCI: Starting initialization.\n");
254254

255255
chan->reg_base = 0xfe040000;
256256

@@ -270,7 +270,7 @@ static int __init sh7780_pci_init(void)
270270

271271
id = __raw_readw(chan->reg_base + PCI_VENDOR_ID);
272272
if (id != PCI_VENDOR_ID_RENESAS) {
273-
printk(KERN_ERR "PCI: Unknown vendor ID 0x%04x.\n", id);
273+
pr_err("PCI: Unknown vendor ID 0x%04x.\n", id);
274274
return -ENODEV;
275275
}
276276

@@ -281,14 +281,13 @@ static int __init sh7780_pci_init(void)
281281
(id == PCI_DEVICE_ID_RENESAS_SH7785) ? "SH7785" :
282282
NULL;
283283
if (unlikely(!type)) {
284-
printk(KERN_ERR "PCI: Found an unsupported Renesas host "
285-
"controller, device id 0x%04x.\n", id);
284+
pr_err("PCI: Found an unsupported Renesas host controller, device id 0x%04x.\n",
285+
id);
286286
return -EINVAL;
287287
}
288288

289-
printk(KERN_NOTICE "PCI: Found a Renesas %s host "
290-
"controller, revision %d.\n", type,
291-
__raw_readb(chan->reg_base + PCI_REVISION_ID));
289+
pr_notice("PCI: Found a Renesas %s host controller, revision %d.\n",
290+
type, __raw_readb(chan->reg_base + PCI_REVISION_ID));
292291

293292
/*
294293
* Now throw it in to register initialization mode and
@@ -395,9 +394,9 @@ static int __init sh7780_pci_init(void)
395394

396395
sh7780_pci66_init(chan);
397396

398-
printk(KERN_NOTICE "PCI: Running at %dMHz.\n",
399-
(__raw_readw(chan->reg_base + PCI_STATUS) & PCI_STATUS_66MHZ) ?
400-
66 : 33);
397+
pr_notice("PCI: Running at %dMHz.\n",
398+
(__raw_readw(chan->reg_base + PCI_STATUS) & PCI_STATUS_66MHZ)
399+
? 66 : 33);
401400

402401
return 0;
403402

arch/sh/drivers/pci/pci.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ int register_pci_controller(struct pci_channel *hose)
120120
* Do not panic here but later - this might happen before console init.
121121
*/
122122
if (!hose->io_map_base) {
123-
printk(KERN_WARNING
124-
"registering PCI controller with io_map_base unset\n");
123+
pr_warn("registering PCI controller with io_map_base unset\n");
125124
}
126125

127126
/*
@@ -145,7 +144,7 @@ int register_pci_controller(struct pci_channel *hose)
145144
for (--i; i >= 0; i--)
146145
release_resource(&hose->resources[i]);
147146

148-
printk(KERN_WARNING "Skipping PCI bus scan due to resource conflict\n");
147+
pr_warn("Skipping PCI bus scan due to resource conflict\n");
149148
return -1;
150149
}
151150

@@ -213,8 +212,8 @@ pcibios_bus_report_status_early(struct pci_channel *hose,
213212
pci_devfn, PCI_STATUS,
214213
status & status_mask);
215214
if (warn)
216-
printk("(%02x:%02x: %04X) ", current_bus,
217-
pci_devfn, status);
215+
pr_cont("(%02x:%02x: %04X) ", current_bus, pci_devfn,
216+
status);
218217
}
219218
}
220219

@@ -249,7 +248,7 @@ pcibios_bus_report_status(struct pci_bus *bus, unsigned int status_mask,
249248
pci_write_config_word(dev, PCI_STATUS, status & status_mask);
250249

251250
if (warn)
252-
printk("(%s: %04X) ", pci_name(dev), status);
251+
pr_cont("(%s: %04X) ", pci_name(dev), status);
253252
}
254253

255254
list_for_each_entry(dev, &bus->devices, bus_list)

0 commit comments

Comments
 (0)