X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_pci.c;h=dcecef8da859b467e08cf3cf0434658b758fb668;hb=7b95252d82267143e647d5fee96c7d9d5bf74560;hp=e3a77e35820cbda7c663f2b737c187ed0f9e2227;hpb=fce0a90a68de507dc827c1ff40d9e446047fa043;p=u-boot diff --git a/common/cmd_pci.c b/common/cmd_pci.c index e3a77e3582..dcecef8da8 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -48,6 +48,7 @@ void pciinfo(int BusNum, int ShortPCIListing) unsigned char HeaderType; unsigned short VendorID; pci_dev_t dev; + int ret; if (!hose) return; @@ -74,7 +75,10 @@ void pciinfo(int BusNum, int ShortPCIListing) if (pci_skip_dev(hose, dev)) continue; - pci_read_config_word(dev, PCI_VENDOR_ID, &VendorID); + ret = pci_read_config_word(dev, PCI_VENDOR_ID, + &VendorID); + if (ret) + goto error; if ((VendorID == 0xFFFF) || (VendorID == 0x0000)) continue; @@ -91,8 +95,12 @@ void pciinfo(int BusNum, int ShortPCIListing) BusNum, Device, Function); pci_header_show(dev); } - } - } + } + } + + return; +error: + printf("Cannot read bus configuration: %d\n", ret); }