summaryrefslogtreecommitdiff
path: root/c/src/lib/libbsp/sparc/shared/pci/pcif.c
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-02-05 17:17:53 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:20 +0200
commit3c236cc2092901b3513e1fb2463399181fa3add7 (patch)
tree607f81670f7faec984edb50d8a771cbc3b3eb3b7 /c/src/lib/libbsp/sparc/shared/pci/pcif.c
parentacf7047e2ac7ece2ceba0a8e13b4df235851f7d0 (diff)
LEON PCI: fix for PCI host bridge driver CFG space access
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sparc/shared/pci/pcif.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/pci/pcif.c b/c/src/lib/libbsp/sparc/shared/pci/pcif.c
index 2dc46a8ad1..bc435b5a80 100644
--- a/c/src/lib/libbsp/sparc/shared/pci/pcif.c
+++ b/c/src/lib/libbsp/sparc/shared/pci/pcif.c
@@ -174,7 +174,7 @@ int pcif_cfg_r32(pci_dev_t dev, int ofs, uint32_t *val)
*/
if (dev == HOST_TGT)
bus = devfn = 0;
- if (bus == 0)
+ else if (bus == 0)
devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0);
else
devfn = PCI_DEV_DEVFUNC(dev);
@@ -241,7 +241,7 @@ int pcif_cfg_w32(pci_dev_t dev, int ofs, uint32_t val)
*/
if (dev == HOST_TGT)
bus = devfn = 0;
- if (bus == 0)
+ else if (bus == 0)
devfn = PCI_DEV_DEVFUNC(dev) + PCI_DEV(0, 6, 0);
else
devfn = PCI_DEV_DEVFUNC(dev);