diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2006-03-24 18:11:29 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-26 22:48:46 -0500 |
commit | b4f382a3e5e20ba867e7aa5b01189a3fd40eea2c (patch) | |
tree | afc522e8e0db3ac287f36ac96a5bb757845612f1 /arch | |
parent | 79c227a92ce9fe0504e9c4aaadf3bfacb0f5f45e (diff) |
[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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/eeh_driver.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c index b811d5ff92f..cc2495a0cdd 100644 --- a/arch/powerpc/platforms/pseries/eeh_driver.c +++ b/arch/powerpc/platforms/pseries/eeh_driver.c | |||
@@ -257,6 +257,7 @@ void handle_eeh_events (struct eeh_event *event) | |||
257 | struct pci_bus *frozen_bus; | 257 | struct pci_bus *frozen_bus; |
258 | int rc = 0; | 258 | int rc = 0; |
259 | enum pci_ers_result result = PCI_ERS_RESULT_NONE; | 259 | enum pci_ers_result result = PCI_ERS_RESULT_NONE; |
260 | const char *pci_str, *drv_str; | ||
260 | 261 | ||
261 | frozen_dn = find_device_pe(event->dn); | 262 | frozen_dn = find_device_pe(event->dn); |
262 | frozen_bus = pcibios_find_pci_bus(frozen_dn); | 263 | frozen_bus = pcibios_find_pci_bus(frozen_dn); |
@@ -291,6 +292,13 @@ void handle_eeh_events (struct eeh_event *event) | |||
291 | 292 | ||
292 | frozen_pdn = PCI_DN(frozen_dn); | 293 | frozen_pdn = PCI_DN(frozen_dn); |
293 | frozen_pdn->eeh_freeze_count++; | 294 | frozen_pdn->eeh_freeze_count++; |
295 | |||
296 | pci_str = pci_name (frozen_pdn->pcidev); | ||
297 | drv_str = pcid_name (frozen_pdn->pcidev); | ||
298 | if (!pci_str) { | ||
299 | pci_str = pci_name (event->dev); | ||
300 | drv_str = pcid_name (event->dev); | ||
301 | } | ||
294 | 302 | ||
295 | if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) | 303 | if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES) |
296 | goto hard_fail; | 304 | goto hard_fail; |
@@ -306,9 +314,7 @@ void handle_eeh_events (struct eeh_event *event) | |||
306 | eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */); | 314 | eeh_slot_error_detail(frozen_pdn, 1 /* Temporary Error */); |
307 | printk(KERN_WARNING | 315 | printk(KERN_WARNING |
308 | "EEH: This PCI device has failed %d times since last reboot: %s - %s\n", | 316 | "EEH: This PCI device has failed %d times since last reboot: %s - %s\n", |
309 | frozen_pdn->eeh_freeze_count, | 317 | frozen_pdn->eeh_freeze_count, drv_str, pci_str); |
310 | pci_name (frozen_pdn->pcidev), | ||
311 | pcid_name(frozen_pdn->pcidev)); | ||
312 | 318 | ||
313 | /* Walk the various device drivers attached to this slot through | 319 | /* Walk the various device drivers attached to this slot through |
314 | * a reset sequence, giving each an opportunity to do what it needs | 320 | * a reset sequence, giving each an opportunity to do what it needs |
@@ -360,9 +366,7 @@ hard_fail: | |||
360 | "EEH: PCI device %s - %s has failed %d times \n" | 366 | "EEH: PCI device %s - %s has failed %d times \n" |
361 | "and has been permanently disabled. Please try reseating\n" | 367 | "and has been permanently disabled. Please try reseating\n" |
362 | "this device or replacing it.\n", | 368 | "this device or replacing it.\n", |
363 | pci_name (frozen_pdn->pcidev), | 369 | drv_str, pci_str, frozen_pdn->eeh_freeze_count); |
364 | pcid_name(frozen_pdn->pcidev), | ||
365 | frozen_pdn->eeh_freeze_count); | ||
366 | 370 | ||
367 | eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */); | 371 | eeh_slot_error_detail(frozen_pdn, 2 /* Permanent Error */); |
368 | 372 | ||