On Fri, Nov 13, 2015 at 5:45 AM, Simon Glass <s...@chromium.org> wrote: > 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 <s...@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; > --
Reviewed-by: Bin Meng <bmeng...@gmail.com> _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot