From 4792689f67ab9d8c5c5ef20febe41224560a2eeb Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Wed, 26 Jul 2017 14:34:09 +0200 Subject: libpayload: Add pci_free_dev() and some boilerplate Add just enough code and boilerplate to keep it compatible with future libflashrom. Change-Id: If0d46fab141da525f8f115d3f6045a8c417569eb Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/20955 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- payloads/libpayload/include/pci/pci.h | 8 ++++++++ payloads/libpayload/libpci/libpci.c | 5 +++++ 2 files changed, 13 insertions(+) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/include/pci/pci.h b/payloads/libpayload/include/pci/pci.h index ee79d45db7..da6d026782 100644 --- a/payloads/libpayload/include/pci/pci.h +++ b/payloads/libpayload/include/pci/pci.h @@ -88,7 +88,14 @@ struct pci_filter { struct pci_dev *devices; }; +enum pci_access_type { /* dummy for code compatibility */ + PCI_ACCESS_AUTO, + PCI_ACCESS_I386_TYPE1, + PCI_ACCESS_MAX +}; + struct pci_access { + unsigned int method; /* dummy for code compatibility */ struct pci_dev *devices; }; @@ -108,5 +115,6 @@ int pci_filter_match(struct pci_filter*, struct pci_dev*); void pci_filter_init(struct pci_access*, struct pci_filter*); void pci_scan_bus(struct pci_access*); struct pci_dev *pci_get_dev(struct pci_access*, u16, u8, u8, u8); +void pci_free_dev(struct pci_dev *); #endif diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c index f715666a78..82203a16e9 100644 --- a/payloads/libpayload/libpci/libpci.c +++ b/payloads/libpayload/libpci/libpci.c @@ -219,3 +219,8 @@ struct pci_dev *pci_get_dev(struct pci_access* pacc, u16 domain, u8 bus, u8 dev, cur->func = func; return cur; } + +void pci_free_dev(struct pci_dev *const dev) +{ + free(dev); +} -- cgit v1.2.3