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]> Tested-by: K S Maan <[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 17ce7d8394..f8a554654b 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2488,7 +2488,7 @@ uint8_t pci_rom_calculate_checksum(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; @@ -2648,7 +2648,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 551ab16139..b52517d292 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(uint8_t *ptr, uint32_t size); +void pci_rom_patch_ids(PCIDevice *pdev, uint8_t *ptr, uint32_t size); #endif -- 2.53.0
