]> git.baikalelectronics.ru Git - uboot.git/commit
dm: pci: Fix device PCI iteration
authorMichal Suchanek <msuchanek@suse.de>
Wed, 12 Oct 2022 19:57:52 +0000 (21:57 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 18 Oct 2022 03:17:12 +0000 (21:17 -0600)
commit74fc1744e6bdc6c577c118a742344294952a0d4e
treebb03c9227817fe28a6add97967a43478994cc4cf
parentad27267b914827ab1b97913a4d16a6c2b1cfe7c3
dm: pci: Fix device PCI iteration

When there is no PCI bus uclass_first_device will return no bus and no
error which will result in pci_find_first_device calling
skip_to_next_device with no bus, and the bus is only checked at the end
of the while cycle, not the beginning.

Fixes: 76c3fbcd3d ("dm: pci: Add a way to iterate through all PCI devices")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/pci/pci-uclass.c