mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
![Helge Deller](/assets/img/avatar_default.png)
Linus noticed odd declaration rules for pci_iounmap() in iomap.h and
pci_iomap.h, where it dependend on either NO_GENERIC_PCI_IOPORT_MAP or
GENERIC_IOMAP when CONFIG_PCI was disabled.
Testing on parisc seems to indicate that we need pci_iounmap() only when
CONFIG_PCI is enabled, so the declaration of pci_iounmap() can be moved
cleanly into pci_iomap.h in sync with the declarations of pci_iomap().
Link: https://lore.kernel.org/all/CAHk-=wjRrh98pZoQ+AzfWmsTZacWxTJKXZ9eKU2X_0+jM=O8nw@mail.gmail.com/
Signed-off-by: Helge Deller <deller@gmx.de>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Fixes: 97a29d59fc
("[PARISC] fix compile break caused by iomap: make IOPORT/PCI mapping functions conditional")
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Ulrich Teichert <krypton@ulrich-teichert.org>
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
58 lines
1.9 KiB
C
58 lines
1.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/* Generic I/O port emulation.
|
|
*
|
|
* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
|
|
* Written by David Howells (dhowells@redhat.com)
|
|
*/
|
|
#ifndef __ASM_GENERIC_PCI_IOMAP_H
|
|
#define __ASM_GENERIC_PCI_IOMAP_H
|
|
|
|
struct pci_dev;
|
|
#ifdef CONFIG_PCI
|
|
/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
|
|
extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
|
|
extern void __iomem *pci_iomap_wc(struct pci_dev *dev, int bar, unsigned long max);
|
|
extern void __iomem *pci_iomap_range(struct pci_dev *dev, int bar,
|
|
unsigned long offset,
|
|
unsigned long maxlen);
|
|
extern void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,
|
|
unsigned long offset,
|
|
unsigned long maxlen);
|
|
extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
|
|
/* Create a virtual mapping cookie for a port on a given PCI device.
|
|
* Do not call this directly, it exists to make it easier for architectures
|
|
* to override */
|
|
#ifdef CONFIG_NO_GENERIC_PCI_IOPORT_MAP
|
|
extern void __iomem *__pci_ioport_map(struct pci_dev *dev, unsigned long port,
|
|
unsigned int nr);
|
|
#else
|
|
#define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr))
|
|
#endif
|
|
|
|
#elif defined(CONFIG_GENERIC_PCI_IOMAP)
|
|
static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline void __iomem *pci_iomap_wc(struct pci_dev *dev, int bar, unsigned long max)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline void __iomem *pci_iomap_range(struct pci_dev *dev, int bar,
|
|
unsigned long offset,
|
|
unsigned long maxlen)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline void __iomem *pci_iomap_wc_range(struct pci_dev *dev, int bar,
|
|
unsigned long offset,
|
|
unsigned long maxlen)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
|
|
{ }
|
|
#endif
|
|
|
|
#endif /* __ASM_GENERIC_PCI_IOMAP_H */
|