[coreboot-gerrit] Change in coreboot[master]: libpayload: Add pci_free_dev() and some boilerplate

Nico Huber (Code Review) gerrit at coreboot.org
Fri Aug 11 13:31:58 CEST 2017


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/20955


Change subject: libpayload: Add pci_free_dev() and some boilerplate
......................................................................

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 <nico.huber at secunet.com>
---
M payloads/libpayload/include/pci/pci.h
M payloads/libpayload/libpci/libpci.c
2 files changed, 13 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/20955/1

diff --git a/payloads/libpayload/include/pci/pci.h b/payloads/libpayload/include/pci/pci.h
index ee79d45..da6d026 100644
--- a/payloads/libpayload/include/pci/pci.h
+++ b/payloads/libpayload/include/pci/pci.h
@@ -88,7 +88,14 @@
 	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 @@
 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 f715666..82203a1 100644
--- a/payloads/libpayload/libpci/libpci.c
+++ b/payloads/libpayload/libpci/libpci.c
@@ -219,3 +219,8 @@
 	cur->func = func;
 	return cur;
 }
+
+void pci_free_dev(struct pci_dev *const dev)
+{
+	free(dev);
+}

-- 
To view, visit https://review.coreboot.org/20955
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If0d46fab141da525f8f115d3f6045a8c417569eb
Gerrit-Change-Number: 20955
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170811/4675738d/attachment.html>


More information about the coreboot-gerrit mailing list