Remove the static qualifier from pci_patch_ids() and rename it to pci_rom_patch_ids(), adding a declaration in include/hw/pci/pci.h so external callers can reuse it.
Reported-by: K S Maan <[email protected]> Signed-off-by: Tomita Moeko <[email protected]> --- hw/pci/pci.c | 4 ++-- include/hw/pci/pci.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index b4235834a0..92d4e71c04 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2492,7 +2492,7 @@ uint8_t pci_rom_calculate_checksum(const uint8_t *ptr, uint32_t size) /* Patch the PCI vendor and device ids in a PCI rom image if necessary. This is needed for an option rom which is used for more than one device. */ -static void pci_patch_ids(PCIDevice *pdev, uint8_t *ptr, uint32_t size) +void pci_rom_patch_ids(PCIDevice *pdev, uint8_t *ptr, uint32_t size) { uint16_t vendor_id; uint16_t device_id; @@ -2654,7 +2654,7 @@ static void pci_add_option_rom(PCIDevice *pdev, Error **errp) if (pdev->rom_need_patch_id) { /* Only the default rom images will be patched (if needed). */ - pci_patch_ids(pdev, ptr, size); + pci_rom_patch_ids(pdev, ptr, size); } } diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 2d8a4ad0eb..298e0e6c31 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -1104,5 +1104,6 @@ void pci_set_power(PCIDevice *pci_dev, bool state); int pci_pm_init(PCIDevice *pci_dev, uint8_t offset, Error **errp); uint8_t pci_rom_calculate_checksum(const uint8_t *ptr, uint32_t size); +void pci_rom_patch_ids(PCIDevice *pdev, uint8_t *ptr, uint32_t size); #endif -- 2.53.0
