diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-02-03 03:03:15 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-02-03 10:38:20 -0500 |
commit | 7b67300f7d9db7dcf855e201db2f0da8f318e40d (patch) | |
tree | 140ff3110ad5ac93e0e812b855a6fd55b7633262 /src/hw/esp-scsi.c | |
parent | 01a30dc7e38859125f4120e4f10f26af4049daf7 (diff) | |
download | seabios-7b67300f7d9db7dcf855e201db2f0da8f318e40d.tar.gz |
pci: Implement '%pP' printf handler for 'struct pci_device' pointers
Handle '%pP' format descriptions as a pointer to a 'struct pci_device'
and display it in bus:device.function (%02x:%02x.%x) format.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/hw/esp-scsi.c')
-rw-r--r-- | src/hw/esp-scsi.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c index cf2cc11e..9abc361f 100644 --- a/src/hw/esp-scsi.c +++ b/src/hw/esp-scsi.c @@ -168,9 +168,7 @@ esp_scsi_add_lun(struct pci_device *pci, u32 iobase, u8 target, u8 lun) llun->lun = lun; llun->iobase = iobase; - char *name = znprintf(16, "esp %02x:%02x.%x %d:%d", - pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf), - pci_bdf_to_fn(pci->bdf), target, lun); + char *name = znprintf(16, "esp %pP %d:%d", pci, target, lun); int prio = bootprio_find_scsi_device(pci, target, lun); int ret = scsi_drive_setup(&llun->drive, name, prio); free(name); @@ -197,9 +195,7 @@ init_esp_scsi(struct pci_device *pci) return; pci_enable_busmaster(pci); - dprintf(1, "found esp at %02x:%02x.%x, io @ %x\n", - pci_bdf_to_bus(pci->bdf), pci_bdf_to_dev(pci->bdf), - pci_bdf_to_fn(pci->bdf), iobase); + dprintf(1, "found esp at %pP, io @ %x\n", pci, iobase); // reset outb(ESP_CMD_RESET, iobase + ESP_CMD); |