@@ -2334,16 +2334,12 @@ static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
*/
while (pci_bus_crs_vendor_id(*l)) {
if (delay > timeout) {
- pr_warn("pci %04x:%02x:%02x.%d: not ready after %dms; giving up\n",
- pci_domain_nr(bus), bus->number,
- PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1);
+ pci_bus_warn(bus, devfn, "not ready after %dms; giving up\n", delay - 1);
return false;
}
if (delay >= 1000)
- pr_info("pci %04x:%02x:%02x.%d: not ready after %dms; waiting\n",
- pci_domain_nr(bus), bus->number,
- PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1);
+ pci_bus_info(bus, devfn, "not ready after %dms; waiting\n", delay - 1);
msleep(delay);
delay *= 2;
@@ -2353,9 +2349,7 @@ static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
}
if (delay >= 1000)
- pr_info("pci %04x:%02x:%02x.%d: ready after %dms\n",
- pci_domain_nr(bus), bus->number,
- PCI_SLOT(devfn), PCI_FUNC(devfn), delay - 1);
+ pci_bus_info(bus, devfn, "ready after %dms\n", delay - 1);
return true;
}
@@ -2482,4 +2482,12 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type);
WARN_ONCE(condition, "%s %s: " fmt, \
dev_driver_string(&(pdev)->dev), pci_name(pdev), ##arg)
+#define pci_bus_printk(level, bus, devfn, fmt, arg...) \
+ printk(level "pci %04x:%02x:%02x.%d: " fmt, \
+ pci_domain_nr(bus), (bus)->number, PCI_SLOT(devfn), PCI_FUNC(devfn), ##arg)
+
+#define pci_bus_err(bus, devfn, fmt, arg...) pci_bus_printk(KERN_ERR, (bus), devfn, fmt, ##arg)
+#define pci_bus_warn(bus, devfn, fmt, arg...) pci_bus_printk(KERN_WARNING, (bus), devfn, fmt, ##arg)
+#define pci_bus_info(bus, devfn, fmt, arg...) pci_bus_printk(KERN_INFO, (bus), devfn, fmt, ##arg)
+
#endif /* LINUX_PCI_H */