[PATCH] powerpc/pseries: Cleanup device name printing.
This avoids printk'ing a NULL string. Signed-off-by: Linas Vepstas <linas@linas.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Родитель
79c227a92c
Коммит
b4f382a3e5
|
@ -257,6 +257,7 @@ void handle_eeh_events (struct eeh_event *event)
|
||||||
struct pci_bus *frozen_bus;
|
struct pci_bus *frozen_bus;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
enum pci_ers_result result = PCI_ERS_RESULT_NONE;
|
enum pci_ers_result result = PCI_ERS_RESULT_NONE;
|
||||||
|
const char *pci_str, *drv_str;
|
||||||
|
|
||||||
frozen_dn = find_device_pe(event->dn);
|
frozen_dn = find_device_pe(event->dn);
|
||||||
frozen_bus = pcibios_find_pci_bus(frozen_dn);
|
frozen_bus = pcibios_find_pci_bus(frozen_dn);
|
||||||
|
@ -292,6 +293,13 @@ void handle_eeh_events (struct eeh_event *event)
|
||||||
frozen_pdn = PCI_DN(frozen_dn);
|
frozen_pdn = PCI_DN(frozen_dn);
|
||||||
frozen_pdn->eeh_freeze_count++;
|
frozen_pdn->eeh_freeze_count++;
|
||||||
|
|
||||||
|
pci_str = pci_name (frozen_pdn->pcidev);
|
||||||
|
drv_str = pcid_name (frozen_pdn->pcidev);
|
||||||
|
if (!pci_str) {
|
||||||
|
pci_str = pci_name (event->dev);
|
||||||
|
drv_str = pcid_name (event->dev);
|
||||||
|
}
|
||||||
|
|
||||||
if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
|
if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
|
||||||
goto hard_fail;
|
goto hard_fail;
|
||||||
|
|
||||||
|
@ -306,9 +314,7 @@ void handle_eeh_events (struct eeh_event *event)
|
||||||
eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */);
|
eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */);
|
||||||
printk(KERN_WARNING
|
printk(KERN_WARNING
|
||||||
"EEH: This PCI device has failed %d times since last reboot: %s - %s\n",
|
"EEH: This PCI device has failed %d times since last reboot: %s - %s\n",
|
||||||
frozen_pdn->eeh_freeze_count,
|
frozen_pdn->eeh_freeze_count, drv_str, pci_str);
|
||||||
pci_name (frozen_pdn->pcidev),
|
|
||||||
pcid_name(frozen_pdn->pcidev));
|
|
||||||
|
|
||||||
/* Walk the various device drivers attached to this slot through
|
/* Walk the various device drivers attached to this slot through
|
||||||
* a reset sequence, giving each an opportunity to do what it needs
|
* a reset sequence, giving each an opportunity to do what it needs
|
||||||
|
@ -360,9 +366,7 @@ hard_fail:
|
||||||
"EEH: PCI device %s - %s has failed %d times \n"
|
"EEH: PCI device %s - %s has failed %d times \n"
|
||||||
"and has been permanently disabled. Please try reseating\n"
|
"and has been permanently disabled. Please try reseating\n"
|
||||||
"this device or replacing it.\n",
|
"this device or replacing it.\n",
|
||||||
pci_name (frozen_pdn->pcidev),
|
drv_str, pci_str, frozen_pdn->eeh_freeze_count);
|
||||||
pcid_name(frozen_pdn->pcidev),
|
|
||||||
frozen_pdn->eeh_freeze_count);
|
|
||||||
|
|
||||||
eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */);
|
eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче