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

PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h

pci_get_legacy_ide_irq() is only used on platforms that support PNP, so
many architectures define it but never use it. Replace uses of it with
ATA_PRIMARY_IRQ() and ATA_SECONDARY_IRQ(), which provide the same
functionality.

Since pci_get_legacy_ide_irq() is no longer used, remove all the
architecture-specific definitions of it as well as asm-generic/pci.h, which
only provides pci_get_legacy_ide_irq()

[bhelgaas: commit log]
Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20220722214944.831438-2-shorne@gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Pierre Morel <pmorel@linux.ibm.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Stafford Horne and committed by
Bjorn Helgaas
ae85b23c f2906aa8

+3 -98
-6
arch/alpha/include/asm/pci.h
··· 56 56 57 57 /* IOMMU controls. */ 58 58 59 - /* TODO: integrate with include/asm-generic/pci.h ? */ 60 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 61 - { 62 - return channel ? 15 : 14; 63 - } 64 - 65 59 #define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index 66 60 67 61 static inline int pci_proc_domain(struct pci_bus *bus)
-5
arch/arm/include/asm/pci.h
··· 22 22 #define HAVE_PCI_MMAP 23 23 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 24 24 25 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 26 - { 27 - return channel ? 15 : 14; 28 - } 29 - 30 25 extern void pcibios_report_status(unsigned int status_mask, int warn); 31 26 32 27 #endif /* __KERNEL__ */
-6
arch/arm64/include/asm/pci.h
··· 23 23 extern int isa_dma_bridge_buggy; 24 24 25 25 #ifdef CONFIG_PCI 26 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 27 - { 28 - /* no legacy IRQ on arm64 */ 29 - return -ENODEV; 30 - } 31 - 32 26 static inline int pci_proc_domain(struct pci_bus *bus) 33 27 { 34 28 return 1;
-6
arch/csky/include/asm/pci.h
··· 18 18 extern int isa_dma_bridge_buggy; 19 19 20 20 #ifdef CONFIG_PCI 21 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 22 - { 23 - /* no legacy IRQ on csky */ 24 - return -ENODEV; 25 - } 26 - 27 21 static inline int pci_proc_domain(struct pci_bus *bus) 28 22 { 29 23 /* always show the domain in /proc */
-6
arch/ia64/include/asm/pci.h
··· 63 63 return (pci_domain_nr(bus) != 0); 64 64 } 65 65 66 - #define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 67 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 68 - { 69 - return channel ? isa_irq_to_vector(15) : isa_irq_to_vector(14); 70 - } 71 - 72 66 #endif /* _ASM_IA64_PCI_H */
-2
arch/m68k/include/asm/pci.h
··· 2 2 #ifndef _ASM_M68K_PCI_H 3 3 #define _ASM_M68K_PCI_H 4 4 5 - #include <asm-generic/pci.h> 6 - 7 5 #define pcibios_assign_all_busses() 1 8 6 9 7 #define PCIBIOS_MIN_IO 0x00000100
-6
arch/mips/include/asm/pci.h
··· 139 139 /* Do platform specific device initialization at pci_enable_device() time */ 140 140 extern int pcibios_plat_dev_init(struct pci_dev *dev); 141 141 142 - /* Chances are this interrupt is wired PC-style ... */ 143 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 144 - { 145 - return channel ? 15 : 14; 146 - } 147 - 148 142 #endif /* _ASM_PCI_H */
-5
arch/parisc/include/asm/pci.h
··· 162 162 #define PCIBIOS_MIN_IO 0x10 163 163 #define PCIBIOS_MIN_MEM 0x1000 /* NBPG - but pci/setup-res.c dies */ 164 164 165 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 166 - { 167 - return channel ? 15 : 14; 168 - } 169 - 170 165 #define HAVE_PCI_MMAP 171 166 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 172 167
-1
arch/powerpc/include/asm/pci.h
··· 39 39 #define pcibios_assign_all_busses() \ 40 40 (pci_has_flag(PCI_REASSIGN_ALL_BUS)) 41 41 42 - #define HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 43 42 static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 44 43 { 45 44 if (ppc_md.pci_get_legacy_ide_irq)
-6
arch/riscv/include/asm/pci.h
··· 23 23 extern int isa_dma_bridge_buggy; 24 24 25 25 #ifdef CONFIG_PCI 26 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 27 - { 28 - /* no legacy IRQ on risc-v */ 29 - return -ENODEV; 30 - } 31 - 32 26 static inline int pci_proc_domain(struct pci_bus *bus) 33 27 { 34 28 /* always show the domain in /proc */
-1
arch/s390/include/asm/pci.h
··· 6 6 #include <linux/mutex.h> 7 7 #include <linux/iommu.h> 8 8 #include <linux/pci_hotplug.h> 9 - #include <asm-generic/pci.h> 10 9 #include <asm/pci_clp.h> 11 10 #include <asm/pci_debug.h> 12 11 #include <asm/sclp.h>
-6
arch/sh/include/asm/pci.h
··· 88 88 return hose->need_domain_info; 89 89 } 90 90 91 - /* Chances are this interrupt is wired PC-style ... */ 92 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 93 - { 94 - return channel ? 15 : 14; 95 - } 96 - 97 91 #endif /* __ASM_SH_PCI_H */
-9
arch/sparc/include/asm/pci.h
··· 40 40 #define get_pci_unmapped_area get_fb_unmapped_area 41 41 #endif /* CONFIG_SPARC64 */ 42 42 43 - #if defined(CONFIG_SPARC64) || defined(CONFIG_LEON_PCI) 44 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 45 - { 46 - return PCI_IRQ_NONE; 47 - } 48 - #else 49 - #include <asm-generic/pci.h> 50 - #endif 51 - 52 43 #endif /* ___ASM_SPARC_PCI_H */
-8
arch/um/include/asm/pci.h
··· 11 11 12 12 extern int isa_dma_bridge_buggy; 13 13 14 - #ifdef CONFIG_PCI 15 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 16 - { 17 - /* no legacy IRQs */ 18 - return -ENODEV; 19 - } 20 - #endif 21 - 22 14 #ifdef CONFIG_PCI_DOMAINS 23 15 static inline int pci_proc_domain(struct pci_bus *bus) 24 16 {
-3
arch/x86/include/asm/pci.h
··· 105 105 106 106 extern void pci_iommu_alloc(void); 107 107 108 - /* generic pci stuff */ 109 - #include <asm-generic/pci.h> 110 - 111 108 #ifdef CONFIG_NUMA 112 109 /* Returns the node based on pci bus */ 113 110 static inline int __pcibus_to_node(const struct pci_bus *bus)
-3
arch/xtensa/include/asm/pci.h
··· 43 43 #define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 44 44 #define arch_can_pci_mmap_io() 1 45 45 46 - /* Generic PCI */ 47 - #include <asm-generic/pci.h> 48 - 49 46 #endif /* _XTENSA_PCI_H */
+3 -2
drivers/pnp/resource.c
··· 17 17 #include <asm/dma.h> 18 18 #include <asm/irq.h> 19 19 #include <linux/pci.h> 20 + #include <linux/libata.h> 20 21 #include <linux/ioport.h> 21 22 #include <linux/init.h> 22 23 ··· 323 322 * treat the compatibility IRQs as busy. 324 323 */ 325 324 if ((progif & 0x5) != 0x5) 326 - if (pci_get_legacy_ide_irq(pci, 0) == irq || 327 - pci_get_legacy_ide_irq(pci, 1) == irq) { 325 + if (ATA_PRIMARY_IRQ(pci) == irq || 326 + ATA_SECONDARY_IRQ(pci) == irq) { 328 327 pnp_dbg(&pnp->dev, " legacy IDE device %s " 329 328 "using irq %d\n", pci_name(pci), irq); 330 329 return 1;
-17
include/asm-generic/pci.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * linux/include/asm-generic/pci.h 4 - * 5 - * Copyright (C) 2003 Russell King 6 - */ 7 - #ifndef _ASM_GENERIC_PCI_H 8 - #define _ASM_GENERIC_PCI_H 9 - 10 - #ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 11 - static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 12 - { 13 - return channel ? 15 : 14; 14 - } 15 - #endif /* HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ */ 16 - 17 - #endif /* _ASM_GENERIC_PCI_H */