summaryrefslogtreecommitdiff
path: root/common/cmd_pci.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-26 19:51:19 -0700
committerSimon Glass <sjg@chromium.org>2015-12-01 06:26:37 -0700
commitca7de76d8c5a12e178593770e0d2272cca2596bb (patch)
treed4e48a15bde26c4fde591d6b740432b67317f172 /common/cmd_pci.c
parentbfa4191e0343e2f9c0001d27295721f6f3e9b7dd (diff)
downloadu-boot-ca7de76d8c5a12e178593770e0d2272cca2596bb.tar.gz
u-boot-ca7de76d8c5a12e178593770e0d2272cca2596bb.tar.bz2
u-boot-ca7de76d8c5a12e178593770e0d2272cca2596bb.zip
pci: Use a separate variable for the bus number
At present in do_pci(), bdf can either mean a bus number or a PCI bus number. Use separate variables instead to reduce confusion. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'common/cmd_pci.c')
-rw-r--r--common/cmd_pci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index f3148a3da0..bed880cbcc 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -408,6 +408,7 @@ pci_cfg_modify (pci_dev_t bdf, ulong addr, ulong size, ulong value, int incrflag
static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
ulong addr = 0, value = 0, size = 0;
+ int busnum = 0;
pci_dev_t bdf = 0;
char cmd = 's';
int ret = 0;
@@ -438,16 +439,15 @@ static int do_pci(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#endif
default: /* scan bus */
value = 1; /* short listing */
- bdf = 0; /* bus number */
if (argc > 1) {
if (argv[argc-1][0] == 'l') {
value = 0;
argc--;
}
if (argc > 1)
- bdf = simple_strtoul(argv[1], NULL, 16);
+ busnum = simple_strtoul(argv[1], NULL, 16);
}
- pciinfo(bdf, value);
+ pciinfo(busnum, value);
return 0;
}