powerpc/cell: Use irq_of_parse_and_map() helper

Instead of calling both of_irq_parse_one() and
irq_create_of_mapping(), call of_irq_parse_and_map() instead which
does the same thing. This gets us closer to making the former 2
functions static.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Rob Herring 2018-01-04 16:45:41 -06:00 committed by Michael Ellerman
parent a0820ff334
commit 8c8933eba0

View file

@ -180,35 +180,22 @@ static int __init spu_map_device_old(struct spu *spu)
static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
{ {
struct of_phandle_args oirq;
int ret;
int i; int i;
for (i=0; i < 3; i++) { for (i=0; i < 3; i++) {
ret = of_irq_parse_one(np, i, &oirq); spu->irqs[i] = irq_of_parse_and_map(np, i);
if (ret) { if (!spu->irqs[i])
pr_debug("spu_new: failed to get irq %d\n", i);
goto err; goto err;
}
ret = -EINVAL;
pr_debug(" irq %d no 0x%x on %pOF\n", i, oirq.args[0],
oirq.np);
spu->irqs[i] = irq_create_of_mapping(&oirq);
if (!spu->irqs[i]) {
pr_debug("spu_new: failed to map it !\n");
goto err;
}
} }
return 0; return 0;
err: err:
pr_debug("failed to map irq %x for spu %s\n", *oirq.args, pr_debug("failed to map irq %x for spu %s\n", i, spu->name);
spu->name);
for (; i >= 0; i--) { for (; i >= 0; i--) {
if (spu->irqs[i]) if (spu->irqs[i])
irq_dispose_mapping(spu->irqs[i]); irq_dispose_mapping(spu->irqs[i]);
} }
return ret; return -EINVAL;
} }
static int spu_map_resource(struct spu *spu, int nr, static int spu_map_resource(struct spu *spu, int nr,