Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Add fwnode handler as input param of pci_register_io_range()

In preparation for having the PCI MMIO helpers use the new generic I/O
space management (logical PIO) we need to add the fwnode handler as an
extra input parameter.

Changes the signature of pci_register_io_range() and its callers as
needed.

Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>

authored by

Gabriele Paoloni and committed by
Bjorn Helgaas
fcfaab30 e2515476

+12 -6
+5 -3
drivers/acpi/pci_root.c
··· 729 729 } 730 730 } 731 731 732 - static void acpi_pci_root_remap_iospace(struct resource_entry *entry) 732 + static void acpi_pci_root_remap_iospace(struct fwnode_handle *fwnode, 733 + struct resource_entry *entry) 733 734 { 734 735 #ifdef PCI_IOBASE 735 736 struct resource *res = entry->res; ··· 739 738 resource_size_t length = resource_size(res); 740 739 unsigned long port; 741 740 742 - if (pci_register_io_range(cpu_addr, length)) 741 + if (pci_register_io_range(fwnode, cpu_addr, length)) 743 742 goto err; 744 743 745 744 port = pci_address_to_pio(cpu_addr); ··· 781 780 else { 782 781 resource_list_for_each_entry_safe(entry, tmp, list) { 783 782 if (entry->res->flags & IORESOURCE_IO) 784 - acpi_pci_root_remap_iospace(entry); 783 + acpi_pci_root_remap_iospace(&device->fwnode, 784 + entry); 785 785 786 786 if (entry->res->flags & IORESOURCE_DISABLED) 787 787 resource_list_destroy_entry(entry);
+3 -1
drivers/of/address.c
··· 2 2 #define pr_fmt(fmt) "OF: " fmt 3 3 4 4 #include <linux/device.h> 5 + #include <linux/fwnode.h> 5 6 #include <linux/io.h> 6 7 #include <linux/ioport.h> 7 8 #include <linux/module.h> ··· 334 333 335 334 if (res->flags & IORESOURCE_IO) { 336 335 unsigned long port; 337 - err = pci_register_io_range(range->cpu_addr, range->size); 336 + err = pci_register_io_range(&np->fwnode, range->cpu_addr, 337 + range->size); 338 338 if (err) 339 339 goto invalid_range; 340 340 port = pci_address_to_pio(range->cpu_addr);
+2 -1
drivers/pci/pci.c
··· 3455 3455 * Record the PCI IO range (expressed as CPU physical address + size). 3456 3456 * Return a negative value if an error has occured, zero otherwise 3457 3457 */ 3458 - int pci_register_io_range(phys_addr_t addr, resource_size_t size) 3458 + int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr, 3459 + resource_size_t size) 3459 3460 { 3460 3461 int err = 0; 3461 3462
+2 -1
include/linux/pci.h
··· 1226 1226 void *alignf_data); 1227 1227 1228 1228 1229 - int pci_register_io_range(phys_addr_t addr, resource_size_t size); 1229 + int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr, 1230 + resource_size_t size); 1230 1231 unsigned long pci_address_to_pio(phys_addr_t addr); 1231 1232 phys_addr_t pci_pio_to_address(unsigned long pio); 1232 1233 int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr);