Blob Blame History Raw
From b8d1525b095cb56394d664d120cdd8a4da91977c Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov@gmail.com>
Date: Fri, 17 Sep 2010 22:33:12 +0400
Subject: [PATCH 04/10] Use HAVE_LIBPCI from config.h instead of NEED_PCI

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
---
 flashrom.c   |    2 +-
 hwaccess.h   |    6 ++++--
 internal.c   |    3 ++-
 programmer.h |    6 ++++--
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/flashrom.c b/flashrom.c
index dce2216..df755c8 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1649,7 +1649,7 @@ void print_sysinfo(void)
 	msg_ginfo(" on unknown machine");
 #endif
 	msg_ginfo(", built with");
-#if NEED_PCI == 1
+#if HAVE_LIBPCI == 1
 #ifdef PCILIB_VERSION
 	msg_ginfo(" libpci %s,", PCILIB_VERSION);
 #else
diff --git a/hwaccess.h b/hwaccess.h
index a58194f..d4dd155 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -24,13 +24,15 @@
 #ifndef __HWACCESS_H__
 #define __HWACCESS_H__ 1
 
+#include "config.h"
+
 #if defined (__i386__) || defined (__x86_64__)
 #if defined(__GLIBC__)
 #include <sys/io.h>
 #endif
 #endif
 
-#if NEED_PCI == 1
+#if HAVE_LIBPCI == 1
 /*
  * libpci headers use the variable name "index" which triggers shadowing
  * warnings on systems which have the index() function in a default #include
@@ -160,7 +162,7 @@ cpu_to_be(64)
 #define le_to_cpu32 cpu_to_le32
 #define le_to_cpu64 cpu_to_le64
 
-#if NEED_PCI == 1
+#if HAVE_LIBPCI == 1
 #if defined (__i386__) || defined (__x86_64__)
 
 #define __FLASHROM_HAVE_OUTB__ 1
diff --git a/internal.c b/internal.c
index 32bfb3a..32f734c 100644
--- a/internal.c
+++ b/internal.c
@@ -22,8 +22,9 @@
 #include <stdlib.h>
 #include "flash.h"
 #include "programmer.h"
+#include "config.h"
 
-#if NEED_PCI == 1
+#if HAVE_LIBPCI == 1
 struct pci_dev *pci_dev_find_filter(struct pci_filter filter)
 {
 	struct pci_dev *temp;
diff --git a/programmer.h b/programmer.h
index cd82dcb..af9790d 100644
--- a/programmer.h
+++ b/programmer.h
@@ -24,6 +24,8 @@
 #ifndef __PROGRAMMER_H__
 #define __PROGRAMMER_H__ 1
 
+#include "config.h"
+
 enum programmer {
 #if CONFIG_INTERNAL == 1
 	PROGRAMMER_INTERNAL,
@@ -211,7 +213,7 @@ void myusec_delay(int usecs);
 void myusec_calibrate_delay(void);
 void internal_delay(int usecs);
 
-#if NEED_PCI == 1
+#if HAVE_LIBPCI == 1
 /* pcidev.c */
 extern uint32_t io_base_addr;
 extern struct pci_access *pacc;
@@ -287,7 +289,7 @@ extern int superio_count;
 #define SUPERIO_VENDOR_NONE	0x0
 #define SUPERIO_VENDOR_ITE	0x1
 #endif
-#if NEED_PCI == 1
+#if HAVE_LIBPCI == 1
 struct pci_dev *pci_dev_find_filter(struct pci_filter filter);
 struct pci_dev *pci_dev_find_vendorclass(uint16_t vendor, uint16_t class);
 struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device);
-- 
1.7.6