Clean up the SB400 chipset enable code. Use pci_dev_find() instead of
setting up a filter and iterating over PCI devices.
Signed-off-by: Carl-Daniel Hailfinger <[email protected]>
Index: flashrom-sb400/chipset_enable.c
===================================================================
--- flashrom-sb400/chipset_enable.c (Revision 463)
+++ flashrom-sb400/chipset_enable.c (Arbeitskopie)
@@ -741,19 +741,11 @@
static int enable_flash_sb400(struct pci_dev *dev, const char *name)
{
uint8_t tmp;
- struct pci_filter f;
struct pci_dev *smbusdev;
/* Look for the SMBus device. */
- pci_filter_init((struct pci_access *)0, &f);
- f.vendor = 0x1002;
- f.device = 0x4372;
+ smbusdev = pci_dev_find(0x1002, 0x4372);
- for (smbusdev = pacc->devices; smbusdev; smbusdev = smbusdev->next) {
- if (pci_filter_match(&f, smbusdev))
- break;
- }
-
if (!smbusdev) {
fprintf(stderr, "ERROR: SMBus device not found. Aborting.\n");
exit(1);
--
http://www.hailfinger.org/
Index: flashrom-sb400/chipset_enable.c
===================================================================
--- flashrom-sb400/chipset_enable.c (Revision 463)
+++ flashrom-sb400/chipset_enable.c (Arbeitskopie)
@@ -741,19 +741,11 @@
static int enable_flash_sb400(struct pci_dev *dev, const char *name)
{
uint8_t tmp;
- struct pci_filter f;
struct pci_dev *smbusdev;
/* Look for the SMBus device. */
- pci_filter_init((struct pci_access *)0, &f);
- f.vendor = 0x1002;
- f.device = 0x4372;
+ smbusdev = pci_dev_find(0x1002, 0x4372);
- for (smbusdev = pacc->devices; smbusdev; smbusdev = smbusdev->next) {
- if (pci_filter_match(&f, smbusdev))
- break;
- }
-
if (!smbusdev) {
fprintf(stderr, "ERROR: SMBus device not found. Aborting.\n");
exit(1);
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot