Message ID | 20230824193712.542167-8-helgaas@kernel.org (mailing list archive) |
---|---|
State | Accepted |
Commit | 058310fc6647a73f61f1b6b95afc131558607c6b |
Delegated to: | Bjorn Helgaas |
Headers | show |
Series | PCI: Miscellaneous cleanups | expand |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 60230da957e0..4d2b11c71e62 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4191,16 +4191,12 @@ int pci_register_io_range(struct fwnode_handle *fwnode, phys_addr_t addr, phys_addr_t pci_pio_to_address(unsigned long pio) { - phys_addr_t address = (phys_addr_t)OF_BAD_ADDR; - #ifdef PCI_IOBASE - if (pio >= MMIO_UPPER_LIMIT) - return address; - - address = logic_pio_to_hwaddr(pio); + if (pio < MMIO_UPPER_LIMIT) + return logic_pio_to_hwaddr(pio); #endif - return address; + return (phys_addr_t) OF_BAD_ADDR; } EXPORT_SYMBOL_GPL(pci_pio_to_address);