From patchwork Thu Jul 11 15:17:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 2826482 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B7FEE9F7D6 for ; Thu, 11 Jul 2013 15:21:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 788A02026A for ; Thu, 11 Jul 2013 15:21:09 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 083EB20268 for ; Thu, 11 Jul 2013 15:21:08 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxIdv-0001Dy-Sd; Thu, 11 Jul 2013 15:18:52 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxIdV-000385-6V; Thu, 11 Jul 2013 15:18:25 +0000 Received: from svenfoo.org ([82.94.215.22] helo=mail.zonque.de) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxId2-00034D-CY for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2013 15:17:58 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 17763C003F; Thu, 11 Jul 2013 17:17:32 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IlaXGB5j9BV0; Thu, 11 Jul 2013 17:17:32 +0200 (CEST) Received: from tamtam.teufel.local (p5099deeb.dip0.t-ipconnect.de [80.153.222.235]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id 00D52C0080; Thu, 11 Jul 2013 17:17:30 +0200 (CEST) From: Daniel Mack To: eric.y.miao@gmail.com, linux@arm.linux.org.uk Subject: [PATCH 1/5] gpio: pxa: remove dead code Date: Thu, 11 Jul 2013 17:17:53 +0200 Message-Id: <1373555877-29887-2-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1373555877-29887-1-git-send-email-zonque@gmail.com> References: <1373555877-29887-1-git-send-email-zonque@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130711_111756_593347_72A53B7E X-CRM114-Status: GOOD ( 13.39 ) X-Spam-Score: -0.2 (/) Cc: Linus Walleij , Arnd Bergmann , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, Daniel Mack X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit f87311743 ("ARM: mmp: add more compatible names in gpio driver") changed the driver logic to determine the number of available GPIOs from the compatible string, and hence obsoleted the (undocumented) child nodes that were previously necessary. However, it left some remainder which can be safely removed now. Also, this patch makes pxa_gpio_probe_dt() return the correct value in case irq_alloc_descs() fails. Signed-off-by: Daniel Mack Cc: Haojian Zhuang Cc: Linus Walleij Cc: Arnd Bergmann Acked-by: Haojian Zhuang --- drivers/gpio/gpio-pxa.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index df2199d..cc13d1b 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -524,8 +524,8 @@ const struct irq_domain_ops pxa_irq_domain_ops = { static int pxa_gpio_probe_dt(struct platform_device *pdev) { - int ret, nr_gpios; - struct device_node *prev, *next, *np = pdev->dev.of_node; + int ret = 0, nr_gpios; + struct device_node *np = pdev->dev.of_node; const struct of_device_id *of_id = of_match_device(pxa_gpio_dt_ids, &pdev->dev); const struct pxa_gpio_id *gpio_id; @@ -537,20 +537,13 @@ static int pxa_gpio_probe_dt(struct platform_device *pdev) gpio_id = of_id->data; gpio_type = gpio_id->type; - next = of_get_next_child(np, NULL); - prev = next; - if (!next) { - dev_err(&pdev->dev, "Failed to find child gpio node\n"); - ret = -EINVAL; - goto err; - } - of_node_put(prev); nr_gpios = gpio_id->gpio_nums; pxa_last_gpio = nr_gpios - 1; irq_base = irq_alloc_descs(-1, 0, nr_gpios, 0); if (irq_base < 0) { dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); + ret = irq_base; goto err; } domain = irq_domain_add_legacy(np, nr_gpios, irq_base, 0,