Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1012214ybe; Thu, 19 Sep 2019 07:22:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwY0p67J+EnqQfv8oZMZSiG5wXTCa2CPzI4WZjVskK2zQYb54qvqU4LAKLvGoLl5NMOiXXq X-Received: by 2002:a17:906:d154:: with SMTP id br20mr14917277ejb.79.1568902932237; Thu, 19 Sep 2019 07:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568902932; cv=none; d=google.com; s=arc-20160816; b=e/p2mZFICLz4RbGnSLImdw3/fxX/pgKXBZY9YRWiIDwpquxnW1s62TglyVuvjW1fc6 H1a0q8jLfYxpADxUSwVet+uw/8GdHhvQfnnK9/e3A+nP4+/RtGd1DKotS+uJH781d334 Kal/xBkH1IgepyV8UlEXG7lnjPFRVUK3IdKEAe73hNIdIy925SFaruKi/zCUh4NLNPWz LmkzdxTA95Z3lvPvu43nbmV8vwgBGf50bjpT6Pn25f7jBYFx+E7IK7eWs7V5shydyedB FYBvDF61AizGnpFg/Bth9hg18a70t7TEuNTZ8CxrORzIwKbV8QKXVvbRkdn/gk6RAxHk qL1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qaeMCYjZPRaH9Ju9SgkSov7Ze/8oIWs13QEihdDThJ8=; b=xjdkWaS5vGys9+6O93GXkbRIfg4ff3dIw9EqFPmsk3TfrCuc/Y0ZyZXKL0Txauy3kP iSAV9w9qtSXqHnbT4YZTv7ZnpKIWQX756OhFCTexsMhuj1qIokAJSdhKWGzGpdtQXSai 8twQSPAGQg21KwN3MXUhcW5OfsN54jynUbsvPlNOPMb+ZHQAV/mMghnJCVWrPU7V7ZD9 CAdl5vtdMDuRF5QbESK5AJztEpAmqqmGFq+Wkm9B/gjY7HB4X3Xwl5sQxBk0JzDmdzJZ V9kbajajwLZ3wGCHwIPX5DQLEBBJCWNarNPF54v0pAVpafhgMETf5EJsegmZXaW9CFqF pH/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=z+2qSOa3; 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 d26si5176501edq.91.2019.09.19.07.21.47; Thu, 19 Sep 2019 07:22:12 -0700 (PDT) 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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=z+2qSOa3; 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 S2389473AbfISOQu (ORCPT + 99 others); Thu, 19 Sep 2019 10:16:50 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:43688 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388712AbfISOQu (ORCPT ); Thu, 19 Sep 2019 10:16:50 -0400 Received: by mail-oi1-f195.google.com with SMTP id t84so2806238oih.10 for ; Thu, 19 Sep 2019 07:16:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qaeMCYjZPRaH9Ju9SgkSov7Ze/8oIWs13QEihdDThJ8=; b=z+2qSOa3cyfelEyS2Tc7A9vemu+IwUiJQqeEP2gEj3gSL1xNk+m7ZN8QluhyS5bXfA I8vH6Zhm8sg5ohv6KRmQicpAHf95W+eBHjtmirVWhc7uSQIokMbjxkyHSipMh+zJ7uav g3TZR0TxEX1iedciFW5eFGEwtEFlpF1n2VMEW4f+MlUH334eb9jav1XI8ouU3mpXzrwJ W+3gCxXBF47XY2HQON0XxJLnNkHzgQTsmW5j4rTpDTRpowEFjPSV9LxZ3YwN8n658w/r t780vK5wrh8QDRjJNbdN63IJzBv1Rh2ItXdhYnVdXxlC0VmaJ+7QAzBMBvenefk5pMU+ YvhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qaeMCYjZPRaH9Ju9SgkSov7Ze/8oIWs13QEihdDThJ8=; b=ArFaUDxKh8X2gdZZ/5wOS89D60SBzauGWwSTvtrNxQVxOjsJRHlBPzwxL7/jeC37Zf 7Y4Kb2acu6b5ABE5u9kK9JHSlHkuVZsTZFZtShU0SvP2r0bFRU329xK3m8qc2zmMJHeU m9pUwEdFPp8b32FqZZ64v6ikxzwUPvls9JQ9S+cwAP83G7j3rJKuUMKX8dF5oq3RbabI DTdnUH8Y94J8PWbifkzYg3g7mXO/VYRfYxeHYjr9wQLkTeq6NGeyfpxaDITZbLH039NT M92xa9IRNVbaoJDjfF8EMX09U5w2joX6rfU6ANgD2ZKBXjiqWP2XGrdu2gnokCOopu5/ JAUg== X-Gm-Message-State: APjAAAVWR/lFiA7lssL3GJwPoMo/JyCo8Zr9W34q197anZxizDsMnuRA jnb59DlVYJRgLsUC97Ult12ozOIKB95JV/fvvbXMKw== X-Received: by 2002:aca:ad09:: with SMTP id w9mr2447606oie.114.1568902609135; Thu, 19 Sep 2019 07:16:49 -0700 (PDT) MIME-Version: 1.0 References: <1568885957-2968-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1568885957-2968-1-git-send-email-Anson.Huang@nxp.com> From: Bartosz Golaszewski Date: Thu, 19 Sep 2019 16:16:38 +0200 Message-ID: Subject: Re: [PATCH V2] gpio: mxc: Only getting second IRQ when there is more than one IRQ To: Anson Huang Cc: Linus Walleij , linux-gpio , LKML , dl-linux-imx Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org czw., 19 wrz 2019 o 11:40 Anson Huang napisa=C5=82(a)= : > > On some of i.MX SoCs like i.MX8QXP, there is ONLY one IRQ for each > GPIO bank, so it is better to check the IRQ count before getting > second IRQ to avoid below error message during probe: > > [ 1.070908] gpio-mxc 5d080000.gpio: IRQ index 1 not found > [ 1.077420] gpio-mxc 5d090000.gpio: IRQ index 1 not found > [ 1.083766] gpio-mxc 5d0a0000.gpio: IRQ index 1 not found > [ 1.090122] gpio-mxc 5d0b0000.gpio: IRQ index 1 not found > [ 1.096470] gpio-mxc 5d0c0000.gpio: IRQ index 1 not found > [ 1.102804] gpio-mxc 5d0d0000.gpio: IRQ index 1 not found > [ 1.109144] gpio-mxc 5d0e0000.gpio: IRQ index 1 not found > [ 1.115475] gpio-mxc 5d0f0000.gpio: IRQ index 1 not found > > Signed-off-by: Anson Huang > --- > Changes since V1: > - use local variable irq_count instead or err to avoid confusion. > --- > drivers/gpio/gpio-mxc.c | 13 ++++++++++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c > index 7907a87..c77d474 100644 > --- a/drivers/gpio/gpio-mxc.c > +++ b/drivers/gpio/gpio-mxc.c > @@ -411,6 +411,7 @@ static int mxc_gpio_probe(struct platform_device *pde= v) > { > struct device_node *np =3D pdev->dev.of_node; > struct mxc_gpio_port *port; > + int irq_count; > int irq_base; > int err; > > @@ -426,9 +427,15 @@ static int mxc_gpio_probe(struct platform_device *pd= ev) > if (IS_ERR(port->base)) > return PTR_ERR(port->base); > > - port->irq_high =3D platform_get_irq(pdev, 1); > - if (port->irq_high < 0) > - port->irq_high =3D 0; > + irq_count =3D platform_irq_count(pdev); > + if (irq_count < 0) > + return irq_count; > + > + if (irq_count > 1) { > + port->irq_high =3D platform_get_irq(pdev, 1); > + if (port->irq_high < 0) > + port->irq_high =3D 0; > + } > > port->irq =3D platform_get_irq(pdev, 0); > if (port->irq < 0) > -- > 2.7.4 > Applied, thanks. Bart