Commit 2bb02e4fe22da5d982867c26e369730ea901f999

Authored by Simon Glass
1 parent 8939df092e

dm: pci: Allow PCI bus numbering aliases

Commit 9cc36a2 'dm: core: Add a flag to control sequence numbering' changed
the default uclass behaviour to not support bus numbering. This is incorrect
for PCI and that commit should have enabled the flag for PCI.

Enable it so that PCI buses can be found and the 'pci' command works again.
Also add a test for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff

drivers/pci/pci-uclass.c
... ... @@ -596,6 +596,7 @@
596 596 UCLASS_DRIVER(pci) = {
597 597 .id = UCLASS_PCI,
598 598 .name = "pci",
  599 + .flags = DM_UC_FLAG_SEQ_ALIAS,
599 600 .post_bind = pci_uclass_post_bind,
600 601 .pre_probe = pci_uclass_pre_probe,
601 602 .post_probe = pci_uclass_post_probe,
... ... @@ -21,6 +21,17 @@
21 21 }
22 22 DM_TEST(dm_test_pci_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
23 23  
  24 +/* Test that sandbox PCI bus numbering works correctly */
  25 +static int dm_test_pci_busnum(struct unit_test_state *uts)
  26 +{
  27 + struct udevice *bus;
  28 +
  29 + ut_assertok(uclass_get_device_by_seq(UCLASS_PCI, 0, &bus));
  30 +
  31 + return 0;
  32 +}
  33 +DM_TEST(dm_test_pci_busnum, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
  34 +
24 35 /* Test that we can use the swapcase device correctly */
25 36 static int dm_test_pci_swapcase(struct unit_test_state *uts)
26 37 {