From a822d1dee4e2a6a035c464426e56d1e5c600d273 Mon Sep 17 00:00:00 2001 From: Andrew Scull Date: Thu, 21 Apr 2022 16:11:12 +0000 Subject: pci: Update dm_pci_bus_to_virt() parameters Add mask parameter and reorder length parameter to match the other PCI address conversion functions. Using PCI_REGION_TYPE as the mask gives the old behaviour. It's converted from a macro to an inline function as the length parameter is now used twice, but should only be calculated once. Signed-off-by: Andrew Scull Reviewed-by: Bin Meng --- drivers/bios_emulator/atibios.c | 4 ++-- drivers/pci/pci-uclass.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/bios_emulator/atibios.c b/drivers/bios_emulator/atibios.c index 9547470a2f7..cdc5ba6ad90 100644 --- a/drivers/bios_emulator/atibios.c +++ b/drivers/bios_emulator/atibios.c @@ -368,8 +368,8 @@ void *PCI_mapBIOSImage(struct udevice *pcidev) return NULL; } - BIOSImage = dm_pci_bus_to_virt(pcidev, BIOSImageBus, - PCI_REGION_MEM, 0, MAP_NOCACHE); + BIOSImage = dm_pci_bus_to_virt(pcidev, BIOSImageBus, 0, PCI_REGION_TYPE, + PCI_REGION_MEM, MAP_NOCACHE); /*Change the PCI BAR registers to map it onto the bus.*/ dm_pci_write_config32(pcidev, BIOSImageBAR, 0); diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c index edcb1a245f0..a193e2511f6 100644 --- a/drivers/pci/pci-uclass.c +++ b/drivers/pci/pci-uclass.c @@ -1596,8 +1596,8 @@ void *dm_pci_map_bar(struct udevice *dev, int bar, size_t offset, size_t len, * a PCI range, but a better check would be to probe for the size of * the bar and prevent overflow more locally. */ - return dm_pci_bus_to_virt(udev, pci_bus_addr + offset, flags, len, - MAP_NOCACHE); + return dm_pci_bus_to_virt(udev, pci_bus_addr + offset, len, + PCI_REGION_TYPE, flags, MAP_NOCACHE); } static int _dm_pci_find_next_capability(struct udevice *dev, u8 pos, int cap) -- cgit v1.3.1