Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp619947ybe; Thu, 19 Sep 2019 00:43:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEmcAWA0JGDsQwL4tRMXGNQZn0SVG9n4YUnAxYIyN2XbwEWSsc5Ql8rrHY13NlW5nkPbj9 X-Received: by 2002:a17:906:5146:: with SMTP id s6mr13221257ejl.1.1568878991810; Thu, 19 Sep 2019 00:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568878991; cv=none; d=google.com; s=arc-20160816; b=rFi1072EQSVhNI3HGHG86AlUuoE9QfDQN9zviNG0Zda7/uBSIHYOgX0gqQO/ZUzcmg 2Ryfv2xxAXl8b/mMOdiXndWWy/l1s5z0YNksyIoJtqrGSP2wMWQzmA/yDS/IfaJBBrQs ntgUD6jXkP2B4Dpv3bSoEQL2MVxDw1Bi+/mRbfV7yLHnLk3Dd7KC87J0MB2ppA0CHI3A Mu8vJqGspfdbXWa8HGayVNWlFza3c73wa8RgZ2ULU2MozvKcRxBYVsR1CcKkMrRfOSsf GbyZKLdVAG0EmDThZt8pF5eJJ72w58sNHbEJ1DqZDo898cMzseBXCg+21iJRJzIH4Prv wTAA== 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=8zgBDSez7/+bzGBV7GF5xRZlniZ5KOtG5kxmVNZ9gtI=; b=MajNSaqVdceDjVVqd3c+ecYi+Z0hX4gWOb2P1z/eQ/1XXloPqIC92lCpV9W+Qw9f1M W3JNFFdz1ALVx2pppmOkTUZ7QCnDbSb1VE5tfF11noEb3UZok4gx8U6B2EADnxhP8wRU pYuz7lCIVBufus4nTX0rwwurK6x8ZzbbahRs2Di9Wsl1By9S+oeQI6OX5+sFpTJLL/52 Gs4Mf7huuJCKXio5XbbvvnYfjLKOhsZFchC6MhVjWFYd0EP/xEQbO5xlVarGhNVbCxh9 d8D/8RKfZJMRkyUM02tO/FEkzjLWcbxacELtPtc97XrhZ9sBP1m4yppYa3VpXDuMdssW 0jLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=xKAPhdRx; 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 y26si4466846edu.176.2019.09.19.00.42.48; Thu, 19 Sep 2019 00:43:11 -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=xKAPhdRx; 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 S2388282AbfISHSO (ORCPT + 99 others); Thu, 19 Sep 2019 03:18:14 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:33519 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388129AbfISHSO (ORCPT ); Thu, 19 Sep 2019 03:18:14 -0400 Received: by mail-oi1-f196.google.com with SMTP id e18so1909819oii.0 for ; Thu, 19 Sep 2019 00:18:12 -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=8zgBDSez7/+bzGBV7GF5xRZlniZ5KOtG5kxmVNZ9gtI=; b=xKAPhdRxODA5Qbmt0V91TPi5abCsKP8XYnfz9GsKDfweG6XpzWo/1wD9t6ELjZo75Q 7SI2L8bFsv+23zYxfXpMVJffnsFXNZsX12RLdcrJhpyhrQ4miGxiI+3kiX38wme0waUM 515ZFhJUGaka43E9V77QtpSipUj86l0F/omjRv0cKMTdtQw4EhcS+gaYDqSOctgsDOyx fOLxRU/dCMwdkfhEO/83fhTUotTZQzKwy7dSrOESjsQF977VRUAu5d7Ik2UUQCND9aE7 m/5S2Xmn++VJmqDzVULwTzZQJG9P5+2MkTpIZcweWbFJeu+mr6C691KhdsjFyisvSKiI sc+A== 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=8zgBDSez7/+bzGBV7GF5xRZlniZ5KOtG5kxmVNZ9gtI=; b=R4B9gXER6CKk6e5OHYhh7ow/z+plOoutfcLPBDb/uGrl7LvaB1kIFqtEjBC01SNXL4 4AwBBpVLVv4IXcd1s6lRW3PGR5C7ak79EBqlsm3w/7kNUhhi1gM/hHFDMhiWcwHGiw9E c67q76lyq+jOGHkq1CCu6YPguLInHAFvgsprJZBwzgxdpXG7an/GTLF8xscXHdxvHXG/ B7tiR3q2N1ArW0m/mM+uDSEprjLW/dQoHUFt9bl0awPBhuNyEUulXQSKLZJ09w1KUSQi g7wCi5Np1NjqRYUqJWgIplKaAuHziwvaoUKx72vnGGhu8p9m3NQ0Jpg2uUWmzkhdlQtH 0tQw== X-Gm-Message-State: APjAAAWsMiTz5W7SBnHKntCpdr/sUHPJimJcZ/zoeXMQwHu8ZW0uXXlm srSBESvOgjx0wQtrcz4kyO/vxRTN85bZ4XWD9WBdow== X-Received: by 2002:aca:4e85:: with SMTP id c127mr1202995oib.21.1568877492010; Thu, 19 Sep 2019 00:18:12 -0700 (PDT) MIME-Version: 1.0 References: <1568873377-13433-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1568873377-13433-1-git-send-email-Anson.Huang@nxp.com> From: Bartosz Golaszewski Date: Thu, 19 Sep 2019 09:18:01 +0200 Message-ID: Subject: Re: [PATCH] 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 08:10 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 > --- > drivers/gpio/gpio-mxc.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c > index 7907a87..39ba7dd 100644 > --- a/drivers/gpio/gpio-mxc.c > +++ b/drivers/gpio/gpio-mxc.c > @@ -426,9 +426,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; > + err =3D platform_irq_count(pdev); > + if (err < 0) > + return err; > + > + if (err > 1) { Could you use a variable called irq_count or something here? This 'err' is a confusing name for a variable that contains a valid value. Bart > + 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 >