linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: cell: use irq_of_parse_and_map helper
@ 2018-01-04 22:45 Rob Herring
  2018-01-04 22:52 ` Arnd Bergmann
  2018-10-04  6:14 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2018-01-04 22:45 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: linux-kernel, Arnd Bergmann, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev

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.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/powerpc/platforms/cell/spu_manage.c | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c
index f636ee22b203..2e01ad5df492 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -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)
 {
-	struct of_phandle_args oirq;
-	int ret;
 	int i;

 	for (i=0; i < 3; i++) {
-		ret = of_irq_parse_one(np, i, &oirq);
-		if (ret) {
-			pr_debug("spu_new: failed to get irq %d\n", i);
-			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");
+		spu->irqs[i] = irq_of_parse_and_map(np, i);
+		if (!spu->irqs[i])
 			goto err;
-		}
 	}
 	return 0;

 err:
-	pr_debug("failed to map irq %x for spu %s\n", *oirq.args,
-		spu->name);
+	pr_debug("failed to map irq %x for spu %s\n", i, spu->name);
 	for (; i >= 0; i--) {
 		if (spu->irqs[i])
 			irq_dispose_mapping(spu->irqs[i]);
 	}
-	return ret;
+	return -EINVAL;
 }

 static int spu_map_resource(struct spu *spu, int nr,
--
2.14.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: cell: use irq_of_parse_and_map helper
  2018-01-04 22:45 [PATCH] powerpc: cell: use irq_of_parse_and_map helper Rob Herring
@ 2018-01-04 22:52 ` Arnd Bergmann
  2018-10-04  6:14 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-01-04 22:52 UTC (permalink / raw)
  To: Rob Herring
  Cc: Michael Ellerman, Linux Kernel Mailing List,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev

On Thu, Jan 4, 2018 at 11:45 PM, Rob Herring <robh@kernel.org> wrote:
> 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.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: powerpc: cell: use irq_of_parse_and_map helper
  2018-01-04 22:45 [PATCH] powerpc: cell: use irq_of_parse_and_map helper Rob Herring
  2018-01-04 22:52 ` Arnd Bergmann
@ 2018-10-04  6:14 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-10-04  6:14 UTC (permalink / raw)
  To: Rob Herring; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel, Arnd Bergmann

On Thu, 2018-01-04 at 22:45:41 UTC, Rob Herring wrote:
> 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.
> 
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/8c8933eba0c2853ecbd6a9ef7542b9

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-04  6:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-04 22:45 [PATCH] powerpc: cell: use irq_of_parse_and_map helper Rob Herring
2018-01-04 22:52 ` Arnd Bergmann
2018-10-04  6:14 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).