PCI: Announce device after early fixups
authorTiezhu Yang <yangtiezhu@loongson.cn>
Mon, 27 Jul 2020 07:06:55 +0000 (15:06 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 29 Jul 2020 22:49:33 +0000 (17:49 -0500)
Announce the device, e.g.,

  pci 0000:00:00.0: [8086:5910] type 00 class 0x060000

after running early fixups, so the log message reflects any device type or
class code fixups.

[bhelgaas: commit log]
Link: https://lore.kernel.org/r/1595833615-8049-1-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c

index 8c40c00..494333d 100644 (file)
@@ -1802,9 +1802,6 @@ int pci_setup_device(struct pci_dev *dev)
        dev->revision = class & 0xff;
        dev->class = class >> 8;                    /* upper 3 bytes */
 
-       pci_info(dev, "[%04x:%04x] type %02x class %#08x\n",
-                  dev->vendor, dev->device, dev->hdr_type, dev->class);
-
        if (pci_early_dump)
                early_dump_pci_device(dev);
 
@@ -1822,6 +1819,9 @@ int pci_setup_device(struct pci_dev *dev)
        /* Early fixups, before probing the BARs */
        pci_fixup_device(pci_fixup_early, dev);
 
+       pci_info(dev, "[%04x:%04x] type %02x class %#08x\n",
+                dev->vendor, dev->device, dev->hdr_type, dev->class);
+
        /* Device class may be changed after fixup */
        class = dev->class >> 8;