Commit 531f254e authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Jesse Barnes

PCIE: aer: use dev_printk when possible

Convert printks to use dev_printk().
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 80ccba11
...@@ -220,8 +220,7 @@ static int __devinit aer_probe (struct pcie_device *dev, ...@@ -220,8 +220,7 @@ static int __devinit aer_probe (struct pcie_device *dev,
/* Alloc rpc data structure */ /* Alloc rpc data structure */
if (!(rpc = aer_alloc_rpc(dev))) { if (!(rpc = aer_alloc_rpc(dev))) {
printk(KERN_DEBUG "%s: Alloc rpc fails on PCIE device[%s]\n", dev_printk(KERN_DEBUG, device, "alloc rpc failed\n");
__func__, device->bus_id);
aer_remove(dev); aer_remove(dev);
return -ENOMEM; return -ENOMEM;
} }
...@@ -229,8 +228,7 @@ static int __devinit aer_probe (struct pcie_device *dev, ...@@ -229,8 +228,7 @@ static int __devinit aer_probe (struct pcie_device *dev,
/* Request IRQ ISR */ /* Request IRQ ISR */
if ((status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv", if ((status = request_irq(dev->irq, aer_irq, IRQF_SHARED, "aerdrv",
dev))) { dev))) {
printk(KERN_DEBUG "%s: Request ISR fails on PCIE device[%s]\n", dev_printk(KERN_DEBUG, device, "request IRQ failed\n");
__func__, device->bus_id);
aer_remove(dev); aer_remove(dev);
return status; return status;
} }
...@@ -274,7 +272,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev) ...@@ -274,7 +272,7 @@ static pci_ers_result_t aer_root_reset(struct pci_dev *dev)
* to issue Configuration Requests to those devices. * to issue Configuration Requests to those devices.
*/ */
msleep(200); msleep(200);
printk(KERN_DEBUG "Complete link reset at Root[%s]\n", dev->dev.bus_id); dev_printk(KERN_DEBUG, &dev->dev, "Root Port link has been reset\n");
/* Enable Root Port's interrupt in response to error messages */ /* Enable Root Port's interrupt in response to error messages */
pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &status); pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &status);
......
...@@ -50,10 +50,10 @@ int aer_osc_setup(struct pcie_device *pciedev) ...@@ -50,10 +50,10 @@ int aer_osc_setup(struct pcie_device *pciedev)
} }
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
printk(KERN_DEBUG "AER service couldn't init device %s - %s\n", dev_printk(KERN_DEBUG, &pciedev->device, "AER service couldn't "
pciedev->device.bus_id, "init device: %s\n",
(status == AE_SUPPORT || status == AE_NOT_FOUND) ? (status == AE_SUPPORT || status == AE_NOT_FOUND) ?
"no _OSC support" : "Run ACPI _OSC fails"); "no _OSC support" : "_OSC failed");
return -1; return -1;
} }
......
...@@ -221,8 +221,8 @@ static void report_error_detected(struct pci_dev *dev, void *data) ...@@ -221,8 +221,8 @@ static void report_error_detected(struct pci_dev *dev, void *data)
* of a driver for this device is unaware of * of a driver for this device is unaware of
* its hw state. * its hw state.
*/ */
printk(KERN_DEBUG "Device ID[%s] has %s\n", dev_printk(KERN_DEBUG, &dev->dev, "device has %s\n",
dev->dev.bus_id, (dev->driver) ? dev->driver ?
"no AER-aware driver" : "no driver"); "no AER-aware driver" : "no driver");
} }
return; return;
...@@ -304,7 +304,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev, ...@@ -304,7 +304,7 @@ static pci_ers_result_t broadcast_error_message(struct pci_dev *dev,
{ {
struct aer_broadcast_data result_data; struct aer_broadcast_data result_data;
printk(KERN_DEBUG "Broadcast %s message\n", error_mesg); dev_printk(KERN_DEBUG, &dev->dev, "broadcast %s message\n", error_mesg);
result_data.state = state; result_data.state = state;
if (cb == report_error_detected) if (cb == report_error_detected)
result_data.result = PCI_ERS_RESULT_CAN_RECOVER; result_data.result = PCI_ERS_RESULT_CAN_RECOVER;
...@@ -404,18 +404,16 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev, ...@@ -404,18 +404,16 @@ static pci_ers_result_t reset_link(struct pcie_device *aerdev,
data.aer_driver = data.aer_driver =
to_service_driver(aerdev->device.driver); to_service_driver(aerdev->device.driver);
} else { } else {
printk(KERN_DEBUG "No link-reset support to Device ID" dev_printk(KERN_DEBUG, &dev->dev, "no link-reset "
"[%s]\n", "support\n");
dev->dev.bus_id);
return PCI_ERS_RESULT_DISCONNECT; return PCI_ERS_RESULT_DISCONNECT;
} }
} }
status = data.aer_driver->reset_link(udev); status = data.aer_driver->reset_link(udev);
if (status != PCI_ERS_RESULT_RECOVERED) { if (status != PCI_ERS_RESULT_RECOVERED) {
printk(KERN_DEBUG "Link reset at upstream Device ID" dev_printk(KERN_DEBUG, &dev->dev, "link reset at upstream "
"[%s] failed\n", "device %s failed\n", pci_name(udev));
udev->dev.bus_id);
return PCI_ERS_RESULT_DISCONNECT; return PCI_ERS_RESULT_DISCONNECT;
} }
...@@ -511,10 +509,12 @@ static void handle_error_source(struct pcie_device * aerdev, ...@@ -511,10 +509,12 @@ static void handle_error_source(struct pcie_device * aerdev,
} else { } else {
status = do_recovery(aerdev, dev, info.severity); status = do_recovery(aerdev, dev, info.severity);
if (status == PCI_ERS_RESULT_RECOVERED) { if (status == PCI_ERS_RESULT_RECOVERED) {
printk(KERN_DEBUG "AER driver successfully recovered\n"); dev_printk(KERN_DEBUG, &dev->dev, "AER driver "
"successfully recovered\n");
} else { } else {
/* TODO: Should kernel panic here? */ /* TODO: Should kernel panic here? */
printk(KERN_DEBUG "AER driver didn't recover\n"); dev_printk(KERN_DEBUG, &dev->dev, "AER driver didn't "
"recover\n");
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment