PCI: export and use pci_msi_get_hwirq in pci-hyperv.c
Subsystems (5)
Wei Liu
maintainerPATCH 1/1 PCI: export and use pci_msi_get_hwirq in pci-hyperv.c
There is a functionally identical function in pci-hyperv.c. Drop it and use pci_msi_get_hwirq instead.
This requires exporting pci_msi_get_hwirq and declaring it in msi.h.
No functional change intended.
--- arch/x86/include/asm/msi.h | 4 ++++ arch/x86/kernel/apic/msi.c | 5 +++-- drivers/pci/controller/pci-hyperv.c | 8 +------- 3 files changed, 8 insertions(+), 9 deletions(-)
arch/x86/include/asm/msi.h +4 -0
@@ -11,4 +11,8 @@ int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,void pci_msi_set_desc (msi_alloc_info_t *arg,struct msi_desc *desc); +struct msi_domain_info ; +irq_hw_number_t pci_msi_get_hwirq (struct msi_domain_info *info, +msi_alloc_info_t *arg); +#endif /* _ASM_X86_MSI_H */
arch/x86/kernel/apic/msi.c +3 -2
@@ -204,11 +204,12 @@ void native_teardown_msi_irq(unsigned int irq)irq_domain_free_irqs (irq,1 ); } -static irq_hw_number_t pci_msi_get_hwirq (struct msi_domain_info *info, -msi_alloc_info_t *arg) +irq_hw_number_t pci_msi_get_hwirq (struct msi_domain_info *info, +msi_alloc_info_t *arg) {return arg->msi_hwirq; } +EXPORT_SYMBOL_GPL (pci_msi_get_hwirq);int pci_msi_prepare (struct irq_domain *domain,struct device *dev,int nvec,msi_alloc_info_t *arg)
drivers/pci/controller/pci-hyperv.c +1 -7
@@ -1520,14 +1520,8 @@ static struct irq_chip hv_msi_irq_chip = { .irq_unmask = hv_irq_unmask, }; -static irq_hw_number_t hv_msi_domain_ops_get_hwirq (struct msi_domain_info *info, -msi_alloc_info_t *arg) -{ -return arg->msi_hwirq; -} -static struct msi_domain_ops hv_msi_ops = { - .get_hwirq = hv_msi_domain_ops_get_hwirq, + .get_hwirq = pci_msi_get_hwirq, .msi_prepare = pci_msi_prepare, .set_desc = pci_msi_set_desc, .msi_free = hv_msi_free,
Signature · 1 line
2.20.1
Rob Herring
reviewerQuoted 5 lines · Wei Liu
There is a functionally identical function in
pci-hyperv.c. Drop it and usepci_msi_get_hwirqinstead.This requires exporting
pci_msi_get_hwirqand declaring it inmsi.h.
Quoted 8 lines
No functional change intended.
Signed-off-by Wei Liu <[email protected]>--- arch/x86/include/asm/msi.h | 4 ++++ arch/x86/kernel/apic/msi.c | 5 +++-- drivers/pci/controller/pci-hyperv.c | 8 +------- 3 files changed, 8 insertions(+), 9 deletions(-)
Would be better if done in a way to remove an x86 dependency.
I guess this would do it:
#define pci_msi_get_hwirq NULL
when GENERIC_MSI_DOMAIN_OPS is enabled.
Quoted 56 lines
arch/x86/include/asm/msi.h +4
-0@@ -11,4 +11,8 @@ int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,void pci_msi_set_desc (msi_alloc_info_t *arg,struct msi_desc *desc); +struct msi_domain_info ; +irq_hw_number_t pci_msi_get_hwirq (struct msi_domain_info *info, +msi_alloc_info_t *arg); +#endif /* _ASM_X86_MSI_H */ arch/x86/kernel/apic/msi.c +3
-2@@ -204,11 +204,12 @@ void native_teardown_msi_irq(unsigned int irq)irq_domain_free_irqs (irq,1 ); } -static irq_hw_number_t pci_msi_get_hwirq (struct msi_domain_info *info, -msi_alloc_info_t *arg) +irq_hw_number_t pci_msi_get_hwirq (struct msi_domain_info *info, +msi_alloc_info_t *arg) {return arg->msi_hwirq; } +EXPORT_SYMBOL_GPL (pci_msi_get_hwirq);int pci_msi_prepare (struct irq_domain *domain,struct device *dev,int nvec,msi_alloc_info_t *arg)drivers/pci/controller/pci-hyperv.c +1
-7@@ -1520,14 +1520,8 @@ static struct irq_chip hv_msi_irq_chip = { .irq_unmask = hv_irq_unmask, }; -static irq_hw_number_t hv_msi_domain_ops_get_hwirq (struct msi_domain_info *info, -msi_alloc_info_t *arg) -{ -return arg->msi_hwirq; -} -static struct msi_domain_ops hv_msi_ops = { - .get_hwirq = hv_msi_domain_ops_get_hwirq, + .get_hwirq = pci_msi_get_hwirq, .msi_prepare = pci_msi_prepare, .set_desc = pci_msi_set_desc, .msi_free = hv_msi_free,Signature · 1 line
2.20.1
Wei Liu
maintainerQuoted 8 lines · Rob Herring
Quoted 7 lines · Wei Liu
There is a functionally identical function in
pci-hyperv.c. Drop it and usepci_msi_get_hwirqinstead.This requires exporting
pci_msi_get_hwirqand declaring it inmsi.h.No functional change intended.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Wei Liu <[email protected]>--- arch/x86/include/asm/msi.h | 4 ++++ arch/x86/kernel/apic/msi.c | 5 +++-- drivers/pci/controller/pci-hyperv.c | 8 +------- 3 files changed, 8 insertions(+), 9 deletions(-)Would be better if done in a way to remove an x86 dependency.
This is a good point, Rob. I will see what I can do.
Wei.
Quoted 6 lines
I guess this would do it:
#define
pci_msi_get_hwirqNULLwhen
GENERIC_MSI_DOMAIN_OPSis enabled.