Edward O'Callaghan has uploaded this change for review.

View Change

pcidev.c: Move pci_dev_find() from internal to canonical place

BUG=none
TEST=builds

Change-Id: Ie21f87699481a84398ca4450b3f03548f0528191
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M internal.c
M pcidev.c
M programmer.h
3 files changed, 12 insertions(+), 14 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/80/59280/1
diff --git a/internal.c b/internal.c
index 0fc150b..508906d 100644
--- a/internal.c
+++ b/internal.c
@@ -29,17 +29,6 @@

enum chipbustype internal_buses_supported = BUS_NONE;

-struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device)
-{
- struct pci_filter filter;
-
- pci_filter_init(NULL, &filter);
- filter.vendor = vendor;
- filter.device = device;
-
- return pcidev_scandev(&filter);
-}
-
#if defined(__i386__) || defined(__x86_64__)
void probe_superio(void)
{
diff --git a/pcidev.c b/pcidev.c
index 9ecd042..721243a 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -204,6 +204,17 @@
return NULL;
}

+struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device)
+{
+ struct pci_filter filter;
+
+ pci_filter_init(NULL, &filter);
+ filter.vendor = vendor;
+ filter.device = device;
+
+ return pcidev_scandev(&filter);
+}
+
struct pci_dev *pcidev_getdev(struct pci_dev *dev)
{
#if !defined(OLD_PCI_GET_DEV)
diff --git a/programmer.h b/programmer.h
index 35306ed..3b08f61 100644
--- a/programmer.h
+++ b/programmer.h
@@ -129,6 +129,7 @@
struct pci_dev *pcidev_getdev(struct pci_dev *dev);
struct pci_dev *pcidev_card_find(uint16_t vendor, uint16_t device,
uint16_t card_vendor, uint16_t card_device);
+struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device);
/* rpci_write_* are reversible writes. The original PCI config space register
* contents will be restored on shutdown.
* To clone the pci_dev instances internally, the `pacc` global
@@ -271,9 +272,6 @@
#define SUPERIO_VENDOR_ITE 0x1
#define SUPERIO_VENDOR_WINBOND 0x2
#endif
-#if NEED_PCI == 1
-struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device);
-#endif
int rget_io_perms(void);
#if CONFIG_INTERNAL == 1
extern int is_laptop;

To view, visit change 59280. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie21f87699481a84398ca4450b3f03548f0528191
Gerrit-Change-Number: 59280
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange