diff options
| -rw-r--r-- | board_enable.c | 24 | 
1 files changed, 9 insertions, 15 deletions
diff --git a/board_enable.c b/board_enable.c index d7408064..7b9e9f64 100644 --- a/board_enable.c +++ b/board_enable.c @@ -1555,23 +1555,17 @@ static int intel_ich_gpio_set(int gpio, int raise)  	int i, allowed;  	/* First, look for a known LPC bridge */ -	for (dev = pacc->devices; dev; dev = dev->next) { -		uint16_t device_class; -		/* libpci before version 2.2.4 does not store class info. */ -		device_class = pci_read_word(dev, PCI_CLASS_DEVICE); -		if ((dev->vendor_id == 0x8086) && -		    (device_class == 0x0601)) { /* ISA bridge */ -			/* Is this device in our list? */ -			for (i = 0; intel_ich_gpio_table[i].id; i++) -				if (dev->device_id == intel_ich_gpio_table[i].id) -					break; - -			if (intel_ich_gpio_table[i].id) -				break; -		} +	dev = pcidev_find_vendorclass(0x8086, 0x0601); /* ISA bridge */ +	if (!dev) { +		msg_perr("\nERROR: No known Intel LPC bridge found.\n"); +		return -1;  	} +	/* Is this device in our list? */ +	for (i = 0; intel_ich_gpio_table[i].id; i++) +		if (dev->device_id == intel_ich_gpio_table[i].id) +			break; -	if (!dev) { +	if (!intel_ich_gpio_table[i].id) {  		msg_perr("\nERROR: No known Intel LPC bridge found.\n");  		return -1;  	}  | 
