[U-Boot] [PATCH 01/14] pci: Move 'pci scan' code in with other commands
Simon Glass
sjg at chromium.org
Thu Nov 12 22:45:22 CET 2015
At present the 'pci scan' code has its own code path. Adjust it so that it
can be placed with the rest of the command processing code. This will allow
us to use common set code for all commands.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
common/cmd_pci.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 69c5332..4f4c341 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -445,11 +445,11 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc > 1)
bdf = simple_strtoul(argv[1], NULL, 16);
}
- pciinfo(bdf, value);
- return 0;
+ cmd = 's';
+ break;
}
- switch (argv[1][0]) {
+ switch (cmd) {
case 'h': /* header */
pci_header_show(bdf);
return 0;
@@ -472,6 +472,9 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc < 4)
goto usage;
return pci_cfg_modify(bdf, addr, size, value, 1);
+ case 's':
+ pciinfo(bdf, value);
+ return 0;
case 'w': /* write */
if (argc < 5)
goto usage;
--
2.6.0.rc2.230.g3dd15c0
More information about the U-Boot
mailing list