From patchwork Thu Jan 4 22:45:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 855842 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zCNGc6ng0z9s7F for ; Fri, 5 Jan 2018 09:47:20 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zCNGc5HcYzF0QC for ; Fri, 5 Jan 2018 09:47:20 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=209.85.218.68; helo=mail-oi0-f68.google.com; envelope-from=robherring2@gmail.com; receiver=) Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zCNDq4zrCzDqxy for ; Fri, 5 Jan 2018 09:45:47 +1100 (AEDT) Received: by mail-oi0-f68.google.com with SMTP id g6so2026672oib.11 for ; Thu, 04 Jan 2018 14:45:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=U7vIJt1rKJ8M2hUhy6sUappYJPVWz6lwd3XIULgVc8Q=; b=PxhNpQzn11HaBmla8NRxbIl9a93ZeHkCFLG5eQOQJcbvm+F4AA3YLr+lmcvvYBnFRB /b0dMPuKEk+/gLOUgqLOoRL8eS/SGhThNQWq4bvoLdS0pMPule6Sz1MuFd9Eh3h0ZIc3 UX3I6Fs8JmCJffUTycTMVjTpRX15bO3vt0Q+7wW4RnXql7uzYzDlNXY6wRCKcY6fVI8B PP4NIVxp+mcaPAEq8FW0xij6asXn9ZyvBvKqa0qs1Uwl4bCaZQWWKZCUAIgqrCWW2S8+ o7iIA8PFFRUbXLd+lwtdYl9Oz5V1SlK5SVChRjZcWXOmZOuKVad3KGHZpMWnTxxfxBVk x9aA== X-Gm-Message-State: AKGB3mIhGEc2KgHlogGDKJ8LsTLDsrOGpjwoCzN2dfV74asNhBZL9Piy 51Ee5nCOz+CZqJ2pa2UE6A== X-Google-Smtp-Source: ACJfBov9FJK9Eh+hmYHhCnPlvsC+LU/BHaXwNMEgiJV531xhZTtmTobNq19VauJBsvsILnz7NJS7cQ== X-Received: by 10.202.106.17 with SMTP id f17mr635760oic.30.1515105945496; Thu, 04 Jan 2018 14:45:45 -0800 (PST) Received: from xps15.usacommunications.tv (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.googlemail.com with ESMTPSA id s63sm1704516oie.41.2018.01.04.14.45.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 14:45:44 -0800 (PST) From: Rob Herring To: Michael Ellerman Subject: [PATCH] powerpc: cell: use irq_of_parse_and_map helper Date: Thu, 4 Jan 2018 16:45:41 -0600 Message-Id: <20180104224542.15333-3-robh@kernel.org> X-Mailer: git-send-email 2.14.1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras , linux-kernel@vger.kernel.org, Arnd Bergmann Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "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 Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring Acked-by: Arnd Bergmann --- arch/powerpc/platforms/cell/spu_manage.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) -- 2.14.1 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,