summaryrefslogtreecommitdiff
path: root/src/device/pci_ops.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-03-04 08:25:27 +0200
committerNico Huber <nico.h@gmx.de>2019-03-06 11:44:06 +0000
commitad7758ca521bab7f1aaa0977516002f905cc0a67 (patch)
tree731dfd804d94ac33ac5be833c22dd1454af3b8cd /src/device/pci_ops.c
parent6fefdfd106baff0cc74551e14d6344408271524a (diff)
downloadcoreboot-ad7758ca521bab7f1aaa0977516002f905cc0a67.tar.xz
device/pci_ops: Change ramstage PCI accessor signatures
This reduces parameter passing and visibility of parsing struct *dev to PCI bus:dev.fn. Change-Id: Ie4232ca1db9cffdf21ed133143acfb7517577736 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31750 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/device/pci_ops.c')
-rw-r--r--src/device/pci_ops.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/device/pci_ops.c b/src/device/pci_ops.c
index 12c4e26d0e..362a6ad7c2 100644
--- a/src/device/pci_ops.c
+++ b/src/device/pci_ops.c
@@ -36,41 +36,35 @@ static void pcidev_assert(const struct device *dev)
u8 pci_read_config8(struct device *dev, unsigned int where)
{
pcidev_assert(dev);
- return pci_bus_ops()->read8(dev->bus->secondary,
- dev->path.pci.devfn, where);
+ return pci_bus_ops()->read8(dev, where);
}
u16 pci_read_config16(struct device *dev, unsigned int where)
{
pcidev_assert(dev);
- return pci_bus_ops()->read16(dev->bus->secondary,
- dev->path.pci.devfn, where);
+ return pci_bus_ops()->read16(dev, where);
}
u32 pci_read_config32(struct device *dev, unsigned int where)
{
pcidev_assert(dev);
- return pci_bus_ops()->read32(dev->bus->secondary,
- dev->path.pci.devfn, where);
+ return pci_bus_ops()->read32(dev, where);
}
void pci_write_config8(struct device *dev, unsigned int where, u8 val)
{
pcidev_assert(dev);
- pci_bus_ops()->write8(dev->bus->secondary,
- dev->path.pci.devfn, where, val);
+ pci_bus_ops()->write8(dev, where, val);
}
void pci_write_config16(struct device *dev, unsigned int where, u16 val)
{
pcidev_assert(dev);
- pci_bus_ops()->write16(dev->bus->secondary,
- dev->path.pci.devfn, where, val);
+ pci_bus_ops()->write16(dev, where, val);
}
void pci_write_config32(struct device *dev, unsigned int where, u32 val)
{
pcidev_assert(dev);
- pci_bus_ops()->write32(dev->bus->secondary,
- dev->path.pci.devfn, where, val);
+ pci_bus_ops()->write32(dev, where, val);
}