diff options
author | Jordan Niethe <jniethe5@gmail.com> | 2019-08-09 14:12:18 +1000 |
---|---|---|
committer | Oliver O'Halloran <oohall@gmail.com> | 2019-08-16 15:51:55 +1000 |
commit | df15dcfc8acc83591889fa3b33100734a6b6bdb7 (patch) | |
tree | b509dfc81f1b0bd02a46aba513c49260865b6998 /platforms | |
parent | 4acb8fe7960acbf13545ccafac691fe95047c714 (diff) | |
download | skiboot-df15dcfc8acc83591889fa3b33100734a6b6bdb7.zip skiboot-df15dcfc8acc83591889fa3b33100734a6b6bdb7.tar.gz skiboot-df15dcfc8acc83591889fa3b33100734a6b6bdb7.tar.bz2 |
pci: Use a macro for accessing PCI BDF Bus Number
Currently when the Bus Number bits of a BDF are needed the bit
operations to get it are free coded. There are many places where the
Bus Number is used, so make a macro to use instead of free coding it
everytime.
Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'platforms')
-rw-r--r-- | platforms/astbmc/vesnin.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platforms/astbmc/vesnin.c b/platforms/astbmc/vesnin.c index 030944e..d138cdc 100644 --- a/platforms/astbmc/vesnin.c +++ b/platforms/astbmc/vesnin.c @@ -267,7 +267,7 @@ static int pciinv_walk(struct phb *phb, struct pci_device *pd, void *data) /* Fill the PCI device inventory description */ pack->device.domain_num = cpu_to_be16(phb->opal_id & 0xffff); - pack->device.bus_num = (pd->bdfn >> 8) & 0xff; + pack->device.bus_num = PCI_BUS_NUM(pd->bdfn); pack->device.device_num = (pd->bdfn >> 3) & 0x1f; pack->device.func_num = pd->bdfn & 0x7; pack->device.vendor_id = cpu_to_be16(PCI_VENDOR_ID(pd->vdid)); |