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: 123461 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp80757qgn; Thu, 4 Jan 2018 14:46:18 -0800 (PST) X-Google-Smtp-Source: ACJfBovIqONgrUvr1Q/ZzltVS5Rnz34gYudRAfxOElWB4MlkiFsZznkIn+/TwaSfGhuDfb6Ioogv X-Received: by 10.98.248.3 with SMTP id d3mr972791pfh.30.1515105978260; Thu, 04 Jan 2018 14:46:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515105978; cv=none; d=google.com; s=arc-20160816; b=G9PTnO6g9JUaSRVljHCUjdMswds6dhukRFB6x6VlaR34XRg4twXtVKjsQPYaad8Q4y /rdCIxOgnk3//d20vOzBVuRSVPyLvuksafUct+RyEio5dmQeEJseKSioWG6bgagX/XFM cCP8maJj81bHjhv47IhrqJC7XPHB0zE1Lt8JPmjn3t10G9gn2HDlvWikatRwtH8U0YX4 JK2xEgLxCU+JfMiI4eL8plApFXZn0o1lYfC18kYjY/Ik7HKS5QvtX0r/hpn+VVf2Ok5Q 7VIzgzXJmO/fKeYsmgigvKYbAufj3NE+Z6On2zwbiyJliFPHw+KMbV3jYtWIhxtEY6BK GSgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=U7vIJt1rKJ8M2hUhy6sUappYJPVWz6lwd3XIULgVc8Q=; b=wz26ZBKk4bFHnd6ECQe3OakNdWvxFWlm31PEkEotMDLgHSVfhbiul79qVGxcijFYtT kBzzJUGE341lr1jSJ1gOgtu9U+fboZ47DcbMkRKkG2sOEfC9ow5DjccxSBZu1oYSKSHv Eg8Z+3ZkU7PS9yohypxOjs3bllVARInN+Wmffk6/7DjU/6xExjqlSn0mrT6d2pzoZyy8 ptcfHwBRl3srcauFKoWXfXU6lJ82lMHLTcnTKU8mhwCYxdViySnnSQFElKelCaQBMzf7 /nbFnHQ/QfohzjAJ8jEL4YyweSTEFjwTQPMpi9OvTlGlku4X0LBo1E9zDPnAG/Mtb99l 4Klw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d126si3024822pfg.11.2018.01.04.14.46.18; Thu, 04 Jan 2018 14:46:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753704AbeADWqO (ORCPT + 10 others); Thu, 4 Jan 2018 17:46:14 -0500 Received: from mail-oi0-f67.google.com ([209.85.218.67]:46182 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753605AbeADWpq (ORCPT ); Thu, 4 Jan 2018 17:45:46 -0500 Received: by mail-oi0-f67.google.com with SMTP id t81so2028934oih.13 for ; Thu, 04 Jan 2018 14:45:45 -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=Ndh/AeT7Hdd2bHxq//kk1Q7uXfllyd8SU53bwyHgyiTjaIorgf1HBlotiaDaf4K8Wq ynttwLKFYrllAWY5Om4wMpAjq+3TUlDmzcyxt0Y6L4fwn/M2CLFAjJ8JzxmpkmZ3vL2g 6Cit7mJ3+dqBhuozW+Clyg9P9/nPrSqL5L9FvEg/aPy8KiGiXgPZ1opOqdVNS6ha/PNS 7Pk1//6OwR+8W/8DPrOXPyv58Ghe9NV5yziMGwprL/S2MpUAfSArdjuqlrQJ/CpTcg0r vQ/rFU0EjkB0mLvb3OquDSJBf08SRFhKj0WEHadiGUJFVOhAOlg32woo8Sce4S9Ws8hz BsRg== X-Gm-Message-State: AKGB3mKwEfaLlQiTmdsNVl8Ops5vCFP9zaqMOW//7095r+yLOI73pYhU s8eKMYraMO9u6cTApUJNxatvVJk= 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 Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev@lists.ozlabs.org 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/powerpc/platforms/cell/spu_manage.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) -- 2.14.1 Acked-by: Arnd Bergmann 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,