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

irqchip/nvic: Use irq_domain_translate_onecell instead of custom func

Make use of newly introduced irq_domain_translate_onecell() instead of
custom made function.

Signed-off-by: Yash Shah <yash.shah@sifive.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/1575976274-13487-3-git-send-email-yash.shah@sifive.com

authored by

Yash Shah and committed by
Marc Zyngier
459c3bc8 b01eccea

+2 -13
+2 -13
drivers/irqchip/irq-nvic.c
··· 45 45 handle_IRQ(irq, regs); 46 46 } 47 47 48 - static int nvic_irq_domain_translate(struct irq_domain *d, 49 - struct irq_fwspec *fwspec, 50 - unsigned long *hwirq, unsigned int *type) 51 - { 52 - if (WARN_ON(fwspec->param_count < 1)) 53 - return -EINVAL; 54 - *hwirq = fwspec->param[0]; 55 - *type = IRQ_TYPE_NONE; 56 - return 0; 57 - } 58 - 59 48 static int nvic_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, 60 49 unsigned int nr_irqs, void *arg) 61 50 { ··· 53 64 unsigned int type = IRQ_TYPE_NONE; 54 65 struct irq_fwspec *fwspec = arg; 55 66 56 - ret = nvic_irq_domain_translate(domain, fwspec, &hwirq, &type); 67 + ret = irq_domain_translate_onecell(domain, fwspec, &hwirq, &type); 57 68 if (ret) 58 69 return ret; 59 70 ··· 64 75 } 65 76 66 77 static const struct irq_domain_ops nvic_irq_domain_ops = { 67 - .translate = nvic_irq_domain_translate, 78 + .translate = irq_domain_translate_onecell, 68 79 .alloc = nvic_irq_domain_alloc, 69 80 .free = irq_domain_free_irqs_top, 70 81 };