diff mbox

[U-Boot] PCI: Cannot read bus configuration

Message ID CAOMZO5DZ7Q1KOBC=EbD2RqyZ8VcOkL_tQeVoN_bU5ctyrj0xPw@mail.gmail.com
State RFC
Delegated to: Simon Glass
Headers show

Commit Message

Fabio Estevam Oct. 7, 2015, 11:07 p.m. UTC
Hi Simon,

On Wed, Oct 7, 2015 at 7:30 PM, Simon Glass <sjg@chromium.org> wrote:

> This added error checking to pci_read_config_word(). It might be worth
> looking at why the access is failing.

I noticed that when VendorID !=0xffff  then pci_read_config_word() returns 0.

In the case when VendorID ==0xffff then it returns -1.

If I do like this:


Then the error message is not printed.

Not familiar with the PCI code, so any suggestions are welcome.

Thanks
diff mbox

Patch

--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -77,7 +77,7 @@  void pciinfo(int BusNum, int ShortPCIListing)

                        ret = pci_read_config_word(dev, PCI_VENDOR_ID,
                                                   &VendorID);
-                       if (ret)
+                       if (ret && (VendorID != 0xFFFF))
                                goto error;
                        if ((VendorID == 0xFFFF) || (VendorID == 0x0000))
                                continue;