From patchwork Sat Jul 29 18:07:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 9870063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E631F60353 for ; Sat, 29 Jul 2017 18:08:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C86C728572 for ; Sat, 29 Jul 2017 18:08:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC844287FF; Sat, 29 Jul 2017 18:08:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 33CA528572 for ; Sat, 29 Jul 2017 18:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Subject:To:Date:Message-Id :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6opAmoSDvTstXwuja86LOvkZ8YD3G8cw7pfiPOFHVic=; b=nJtuP1szdIP1A8 yuAobTl8buDqtn4wS6HPBNvPSM+U36xnyUuwcWi1lZaZE3BQ0UhwJw6ecsf1rJkzlcM3QShdtdQsi d/gmHQMjiLGGxWuw8eSZWwLpzAEfzXLT/ze2YH7YuAmXW//CwaVXJaAX76Dge8Dv9ML4c6VtR2Lg5 vayADmX3GOc/N4FhfkuSBckhJxuFtvAtr99R8Odhz2KT86Di1TsDwvRhFMOiEzxw0BxKW4kt8RV/z W/sRgkOZnDPai+FgFrqpQUOj2LiYIk69kiUMEhZchqNFs4siuXK70jwIPchuC2QRW5IctFo8KOOMX IIXJPvOWcbfU6a7K4eYQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dbW9w-0000EV-DW; Sat, 29 Jul 2017 18:08:16 +0000 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dbW9r-0000Di-N5 for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2017 18:08:13 +0000 Received: by mail-lf0-x22f.google.com with SMTP id y15so101059118lfd.5 for ; Sat, 29 Jul 2017 11:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=1gi3yX9aLLYlmdoIhztQCIxKWzHayzDpfSf++JavcBQ=; b=DIfk8ozXlTZyCcGgcTT11NjkTrw7Wnz8Dz+AY/oyw8ANMQSQW+4A+GXveuzMbZQy0D WnA7KRVNPvp2zIl7LR5N5lMRbqNmd+eRQVCchGo0QdJPWuBasUb++Pr7rcW2se+jU2k2 Q+Q4niJEnbKXiZurWnXuCBZcxPD/1UP/1ddXdOsrKTqbJ6V7a3yzgCBT/Lehdyl2sq5J bpreApMvWO9NHpb+4lOAmYqwfCdLOJbMJO3Pz/fGRtykEEIPgM/Flv8mF3JPE+yZN1nf 0OfRrO9pjUv/iCw9FIhPn0rrETCTpkvVU8Tb2tYrLsFx2dpWTl9s25wqmMTmMRYoWtQ9 OIYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=1gi3yX9aLLYlmdoIhztQCIxKWzHayzDpfSf++JavcBQ=; b=PVOgG5daBFnJEYfuzc/Baw/ebcFZQ2aK7XWo9OIwVoAIjwYs30SJaCIlpSFmZwQC4w v8KrJJT7k/0qaaNHUk764HpBVIs984dsEwtllYOAfWgwOKZk5J3nme974Bn+EfmVxAtE 84bWELZ8uTLQYzwrziaBfzH1bduf0/QTsxr2++DrWxmyq6jg/ZgjkBKfpkPbZ30ge4hV 8ioJEc0EONZGLgt7zPlV1/BkykKzspn+gOKv1swtMLgYp2WholpV74kjkIShUBYqx5Rw NP1Ifu9n3+3Hwt2UBo6IjVblWHdW9MW4U7MDjBpuMus9WSQIFYYMb0EQI3Axpuf0zTId uTBQ== X-Gm-Message-State: AIVw113EBdtavfk1YC5fsVBNegdNYND2Q7Cf6yB50yb2y3HIA4cDOYW0 mr1L4BHd8FJ1UtU6 X-Received: by 10.25.151.19 with SMTP id z19mr4211472lfd.134.1501351669211; Sat, 29 Jul 2017 11:07:49 -0700 (PDT) Received: from wasted.cogentembedded.com ([31.173.85.243]) by smtp.gmail.com with ESMTPSA id h4sm2944759lji.87.2017.07.29.11.07.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jul 2017 11:07:47 -0700 (PDT) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Sat, 29 Jul 2017 21:07:44 +0300 Message-Id: <20170729180744.873303067@cogentembedded.com> User-Agent: quilt/0.64 Date: Sat, 29 Jul 2017 21:07:07 +0300 To: Patrice Chotard , Linus Walleij , linux-gpio@vger.kernel.org Subject: [PATCH] pinctrl-st: fix of_irq_to_resource() result check MIME-Version: 1.0 Content-Disposition: inline; filename=pinctrl-st-fix-of_irq_to_resource-result-check.patch X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170729_110812_086359_7B33E6EE X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sergei Shtylyov , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP of_irq_to_resource() has recently been fixed to return negative error #'s along with 0 in case of failure, however the ST driver still only regards 0 as failure indication -- fix it up. Fixes: 7a4228bbff76 ("of: irq: use of_irq_get() in of_irq_to_resource()") Signed-off-by: Sergei Shtylyov --- drivers/pinctrl/pinctrl-st.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-pinctrl/drivers/pinctrl/pinctrl-st.c =================================================================== --- linux-pinctrl.orig/drivers/pinctrl/pinctrl-st.c +++ linux-pinctrl/drivers/pinctrl/pinctrl-st.c @@ -1521,7 +1521,7 @@ static int st_gpiolib_register_bank(stru * [irqN]----> [gpio-bank (n)] */ - if (of_irq_to_resource(np, 0, &irq_res)) { + if (of_irq_to_resource(np, 0, &irq_res) > 0) { gpio_irq = irq_res.start; gpiochip_set_chained_irqchip(&bank->gpio_chip, &st_gpio_irqchip, gpio_irq, st_gpio_irq_handler);