static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info,
                                bool found)
 {
-       u8 bus = info->id >> 8;
-       u8 devfn = info->id & 0xff;
+       u16 source = info->id;
 
        pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d%s\n",
                 info->multi_error_valid ? "Multiple " : "",
                 aer_error_severity_string[info->severity],
-                pci_domain_nr(dev->bus), bus, PCI_SLOT(devfn),
-                PCI_FUNC(devfn), found ? "" : " (no details found");
+                pci_domain_nr(dev->bus), PCI_BUS_NUM(source),
+                PCI_SLOT(source), PCI_FUNC(source),
+                found ? "" : " (no details found");
 }
 
 #ifdef CONFIG_ACPI_APEI_PCIEAER