Skip to content

Commit 8c8933e

Browse files
robherringmpe
authored andcommitted
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>
1 parent a0820ff commit 8c8933e

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

arch/powerpc/platforms/cell/spu_manage.c

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -180,35 +180,22 @@ static int __init spu_map_device_old(struct spu *spu)
180180

181181
static int __init spu_map_interrupts(struct spu *spu, struct device_node *np)
182182
{
183-
struct of_phandle_args oirq;
184-
int ret;
185183
int i;
186184

187185
for (i=0; i < 3; i++) {
188-
ret = of_irq_parse_one(np, i, &oirq);
189-
if (ret) {
190-
pr_debug("spu_new: failed to get irq %d\n", i);
191-
goto err;
192-
}
193-
ret = -EINVAL;
194-
pr_debug(" irq %d no 0x%x on %pOF\n", i, oirq.args[0],
195-
oirq.np);
196-
spu->irqs[i] = irq_create_of_mapping(&oirq);
197-
if (!spu->irqs[i]) {
198-
pr_debug("spu_new: failed to map it !\n");
186+
spu->irqs[i] = irq_of_parse_and_map(np, i);
187+
if (!spu->irqs[i])
199188
goto err;
200-
}
201189
}
202190
return 0;
203191

204192
err:
205-
pr_debug("failed to map irq %x for spu %s\n", *oirq.args,
206-
spu->name);
193+
pr_debug("failed to map irq %x for spu %s\n", i, spu->name);
207194
for (; i >= 0; i--) {
208195
if (spu->irqs[i])
209196
irq_dispose_mapping(spu->irqs[i]);
210197
}
211-
return ret;
198+
return -EINVAL;
212199
}
213200

214201
static int spu_map_resource(struct spu *spu, int nr,

0 commit comments

Comments
 (0)