dm: pci: Fix scanning multi-function device
authorBin Meng <bmeng.cn@gmail.com>
Fri, 3 Aug 2018 08:14:37 +0000 (01:14 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 8 Aug 2018 11:49:31 +0000 (12:49 +0100)
The flag to control whether to scan multi-function device during
enumeration should be cleared at the beginning of each iteration
if the device's function number equals to zero.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/pci/pci-uclass.c

index b2909a325ac3773f17549dda02d42988c04f564d..28ea8c5d4eea8bd3fb2b8099be2c6c73c7af68f6 100644 (file)
@@ -745,6 +745,8 @@ int pci_bind_bus_devices(struct udevice *bus)
                struct udevice *dev;
                ulong class;
 
+               if (!PCI_FUNC(bdf))
+                       found_multi = false;
                if (PCI_FUNC(bdf) && !found_multi)
                        continue;
                /* Check only the first access, we don't expect problems */