Skip to content

Commit d494d08

Browse files
author
Marc Zyngier
committed
irqchip/qcom-pdc: Kill qcom_pdc_translate helper
qcom_pdc_translate() really is nothing but an open coded version of irq_domain_translate_twocell(). Get rid of it and use the common version instead. Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com> Link: https://lore.kernel.org/r/20220224101226.88373-4-maz@kernel.org
1 parent 4dc7071 commit d494d08

1 file changed

Lines changed: 2 additions & 17 deletions

File tree

drivers/irqchip/qcom-pdc.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,21 +198,6 @@ static struct pdc_pin_region *get_pin_region(int pin)
198198
return NULL;
199199
}
200200

201-
static int qcom_pdc_translate(struct irq_domain *d, struct irq_fwspec *fwspec,
202-
unsigned long *hwirq, unsigned int *type)
203-
{
204-
if (is_of_node(fwspec->fwnode)) {
205-
if (fwspec->param_count != 2)
206-
return -EINVAL;
207-
208-
*hwirq = fwspec->param[0];
209-
*type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK;
210-
return 0;
211-
}
212-
213-
return -EINVAL;
214-
}
215-
216201
static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq,
217202
unsigned int nr_irqs, void *data)
218203
{
@@ -223,7 +208,7 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq,
223208
unsigned int type;
224209
int ret;
225210

226-
ret = qcom_pdc_translate(domain, fwspec, &hwirq, &type);
211+
ret = irq_domain_translate_twocell(domain, fwspec, &hwirq, &type);
227212
if (ret)
228213
return ret;
229214

@@ -256,7 +241,7 @@ static int qcom_pdc_alloc(struct irq_domain *domain, unsigned int virq,
256241
}
257242

258243
static const struct irq_domain_ops qcom_pdc_ops = {
259-
.translate = qcom_pdc_translate,
244+
.translate = irq_domain_translate_twocell,
260245
.alloc = qcom_pdc_alloc,
261246
.free = irq_domain_free_irqs_common,
262247
};

0 commit comments

Comments
 (0)