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

powerpc/pasemi: Only the build the pasemi MSI code for PASEMI=y

The pasemi MSI code is currently always built when MPIC=y && PCI_MSI=y.
It should not have any effect on other platforms, because it immediately
checks the MPIC's compatible property for "pasemi,pwrficient-openpic".

However it's odd that it's still built even when PASEMI=n. It also
needn't be in sysdev, as it's only used by pasemi. So move it into
platforms/pasemi, whereby it will only be built for PASEMI=y.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

+8 -9
+1
arch/powerpc/platforms/pasemi/Makefile
··· 1 1 obj-y += setup.o pci.o time.o idle.o powersave.o iommu.o dma_lib.o misc.o 2 2 obj-$(CONFIG_PPC_PASEMI_MDIO) += gpio_mdio.o 3 + obj-$(CONFIG_PCI_MSI) += msi.o
+1 -1
arch/powerpc/sysdev/Makefile
··· 2 2 3 3 ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC) 4 4 5 - mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o 5 + mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o 6 6 obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y) 7 7 obj-$(CONFIG_MPIC_TIMER) += mpic_timer.o 8 8 obj-$(CONFIG_FSL_MPIC_TIMER_WAKEUP) += fsl_mpic_timer_wakeup.o
+5 -5
arch/powerpc/sysdev/mpic.h
··· 15 15 extern void mpic_msi_reserve_hwirq(struct mpic *mpic, irq_hw_number_t hwirq); 16 16 extern int mpic_msi_init_allocator(struct mpic *mpic); 17 17 extern int mpic_u3msi_init(struct mpic *mpic); 18 - extern int mpic_pasemi_msi_init(struct mpic *mpic); 19 18 #else 20 19 static inline void mpic_msi_reserve_hwirq(struct mpic *mpic, 21 20 irq_hw_number_t hwirq) ··· 26 27 { 27 28 return -1; 28 29 } 30 + #endif 29 31 30 - static inline int mpic_pasemi_msi_init(struct mpic *mpic) 31 - { 32 - return -1; 33 - } 32 + #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PPC_PASEMI) 33 + int mpic_pasemi_msi_init(struct mpic *mpic); 34 + #else 35 + static inline int mpic_pasemi_msi_init(struct mpic *mpic) { return -1; } 34 36 #endif 35 37 36 38 extern int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type);
+1 -3
arch/powerpc/sysdev/mpic_pasemi_msi.c arch/powerpc/platforms/pasemi/msi.c
··· 13 13 * 14 14 */ 15 15 16 - #undef DEBUG 17 - 18 16 #include <linux/irq.h> 19 17 #include <linux/msi.h> 20 18 #include <asm/mpic.h> ··· 21 23 #include <asm/ppc-pci.h> 22 24 #include <asm/msi_bitmap.h> 23 25 24 - #include "mpic.h" 26 + #include <sysdev/mpic.h> 25 27 26 28 /* Allocate 16 interrupts per device, to give an alignment of 16, 27 29 * since that's the size of the grouping w.r.t. affinity. If someone