diff mbox series

[4/6] PCI: allow architecture specific implementation of pci_remap_iospace()

Message ID 20210924211139.3477-5-sergio.paracuellos@gmail.com
State New
Headers show
Series MIPS: ralink: fix PCI IO resources | expand

Commit Message

Sergio Paracuellos Sept. 24, 2021, 9:11 p.m. UTC
pci_remap_iospace() was originally meant as an architecture specific helper,
but it moved into generic code after all architectures had the same requirements.
MIPS has different requirements so it should not be shared. The way for doing
this will be using a macro 'pci_remap_iospace' defined for those architectures
that need a special treatement. Hence, put core api function inside preprocesor
conditional code for 'pci_remap_iospace' definition.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/pci/pci.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Bjorn Helgaas Sept. 25, 2021, 2:42 a.m. UTC | #1
s/PCI: allow architecture specific implementation of/
  PCI: Allow architecture-specific pci_remap_iospace()/

(in subject)

On Fri, Sep 24, 2021 at 11:11:37PM +0200, Sergio Paracuellos wrote:
> pci_remap_iospace() was originally meant as an architecture specific helper,
> but it moved into generic code after all architectures had the same requirements.
> MIPS has different requirements so it should not be shared. The way for doing
> this will be using a macro 'pci_remap_iospace' defined for those architectures
> that need a special treatement. Hence, put core api function inside preprocesor
> conditional code for 'pci_remap_iospace' definition.

Rewrap above to fit in 75 columns so "git log" output doesn't wrap.
Add blank line between paragraphs.

s/treatement/treatment/
s/api/API/

> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>

With above fixed,

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
>  drivers/pci/pci.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index ce2ab62b64cf..0ec57bb01a88 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -4123,6 +4123,7 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address)
>   * architectures that have memory mapped IO functions defined (and the
>   * PCI_IOBASE value defined) should call this function.
>   */
> +#ifndef pci_remap_iospace
>  int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
>  {
>  #if defined(PCI_IOBASE) && defined(CONFIG_MMU)
> @@ -4146,6 +4147,7 @@ int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
>  #endif
>  }
>  EXPORT_SYMBOL(pci_remap_iospace);
> +#endif
>  
>  /**
>   * pci_unmap_iospace - Unmap the memory mapped I/O space
> -- 
> 2.25.1
>
Arnd Bergmann Sept. 25, 2021, 5:38 p.m. UTC | #2
On Fri, Sep 24, 2021 at 11:11 PM Sergio Paracuellos
<sergio.paracuellos@gmail.com> wrote:
>
> pci_remap_iospace() was originally meant as an architecture specific helper,
> but it moved into generic code after all architectures had the same requirements.
> MIPS has different requirements so it should not be shared. The way for doing
> this will be using a macro 'pci_remap_iospace' defined for those architectures
> that need a special treatement. Hence, put core api function inside preprocesor
> conditional code for 'pci_remap_iospace' definition.
>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>
diff mbox series

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ce2ab62b64cf..0ec57bb01a88 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -4123,6 +4123,7 @@  unsigned long __weak pci_address_to_pio(phys_addr_t address)
  * architectures that have memory mapped IO functions defined (and the
  * PCI_IOBASE value defined) should call this function.
  */
+#ifndef pci_remap_iospace
 int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
 {
 #if defined(PCI_IOBASE) && defined(CONFIG_MMU)
@@ -4146,6 +4147,7 @@  int pci_remap_iospace(const struct resource *res, phys_addr_t phys_addr)
 #endif
 }
 EXPORT_SYMBOL(pci_remap_iospace);
+#endif
 
 /**
  * pci_unmap_iospace - Unmap the memory mapped I/O space