Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp404542ybl; Wed, 11 Dec 2019 01:32:32 -0800 (PST) X-Google-Smtp-Source: APXvYqz8fQ4pnxARnVHuIYDYTFSlOT/BH4APttVPjVWwlfQCbYJBOBlcpjXd1GiSvHsa5itJTYFm X-Received: by 2002:a9d:7ada:: with SMTP id m26mr1622045otn.111.1576056751996; Wed, 11 Dec 2019 01:32:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576056751; cv=none; d=google.com; s=arc-20160816; b=Nfr+hin4CpZOGdZzJkZ0HsNCNYNuweO2JE1BLImM5Gwp6RPvV0ftWavR2oXy1M0gqC U3Y3wtqxAUxcd+lrNMJVC3AVbmk/6iBXK4rJRIAio//aTIUh3oHNzV5RDFLeLps7eXFH SnDEf9MitQgWJngyixq8/ChOMzJpEk0/77HaEi1zsQC1pJFTtWfTG+LPRWyYZROiYa/p SmGUptSWXpV8by9eLYOxwXoZSalOD/fUC7uww2HfIgUlfGz1sOwN8eq7KLFVbt6bsEOx NiM08ySw4ZWftgv77Lzb28Me3rKYEUU4OznEsTOgcqb0IxfZ92a4jaSkeKNJYMQASB/q hwpg== 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=2BC+9/TiZfps/b95kJW4uBoQA4KaDxSNdYTJBUn4gCs=; b=QkfAcOJZf4o0WYqQtrMINpBX2XBHuWp2+qzErK8PYKoNe7FUVef7kGQxf7f6HMk8tJ fnVmjOuKE1p5kwgMdS33zAlg3BCnUhIsde03W7X2bcTjltnwYgEI/Ol3f7BtZROGKIgi +ZD1XFhx94YfdeH4jPA9anXc/3/GopS/7ZIuHpmz0xGgtYp4zIuIxerhV628vp4kksHl w8dUwL5NDs8hn3Ux4Zd2hSJIEc+7eJ5kQXepfdU2d4zDQUGJMgvRCy4HDxX005eg3BNB YhiIxsFVBJbYXwiCZyxabXHJT5y1FnzKFlQC663GsryfxFkEe1d1VuQcFXiazqgO86Ci iwUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NPdllIBA; 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 j16si648886otp.316.2019.12.11.01.32.19; Wed, 11 Dec 2019 01:32:31 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=NPdllIBA; 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 S1728519AbfLKJap (ORCPT + 99 others); Wed, 11 Dec 2019 04:30:45 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:35344 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728404AbfLKJao (ORCPT ); Wed, 11 Dec 2019 04:30:44 -0500 Received: by mail-qt1-f193.google.com with SMTP id s8so5710621qte.2 for ; Wed, 11 Dec 2019 01:30:44 -0800 (PST) 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=2BC+9/TiZfps/b95kJW4uBoQA4KaDxSNdYTJBUn4gCs=; b=NPdllIBA+bj+UStDT7bl1Rv1PclFC4OqrdpoNdXo7cz0Mj3FkjxI7pucjAVFANaogi NffE55LMj+mJ4LTVFm3bo448ejF9005PtfGOKoL+yTsoq5GKf6d0nGG27QNWKnRCeR0N p9x0u0eR+7IbL+Q6djt0iTdnKLCIC3O6fdu2+FXFF20Ghki/CCvNgGlK2G6q7JTApE73 it0Wf6/UpiTErJcyhUgIPY4BHonA5IkzXb9j2/d0yRW8o99nrsbIYRxYpNzgVy0E6A/3 vTglo5Mm4bq6+Ay6AKQU8yPUea8RGK3cdIxqXAqKlbCktXdNOBxZxzbzJB8yfqSQnjrL j5qA== 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=2BC+9/TiZfps/b95kJW4uBoQA4KaDxSNdYTJBUn4gCs=; b=eO9CFYw0L7OAVYjoKPIurOT8fKiB31IYDU2eEpFYTk6zIaydevyicAsc3r/CbdO12R m7dgUbHX4OjDpNkjXyMwZP2Onpj4LxcudZ5zUj1nLwKYJRwqnOWrUS1q5Pyv7w9Vsd1z VbdMN9yW4cwxuCg5cJJQ1xjAg0e18EoP4cpIaDtgG1el8rxjhNtNF0smeiH4nfxnD9Li +qVlBtXGfGyGDUgrFLI74SujJNSXRh5hYBUFp0c9nxy7YtsqZXgfReqZkFNsk9+UbRVa SeNW0i5F+HtsbdnF4O7htqZdGH5Tqyy4kM4JGmyxNyx6ANjFlizGD2K/XOPZ3XmR/Zwg jdpg== X-Gm-Message-State: APjAAAVy/Mdt/h560HFTmXB6ihzM7SweWFVz502t2XD2OqbNPtf9jYTF jNICcy9DGexN7nSJDJEtHuEyegePuxnkxAuXPOf7Xg== X-Received: by 2002:ac8:6691:: with SMTP id d17mr1791217qtp.57.1576056643909; Wed, 11 Dec 2019 01:30:43 -0800 (PST) MIME-Version: 1.0 References: <1575451330-11112-1-git-send-email-peng.fan@nxp.com> <1575451330-11112-2-git-send-email-peng.fan@nxp.com> <20191204100925.sjp6cztozlm5qm6y@pengutronix.de> In-Reply-To: <20191204100925.sjp6cztozlm5qm6y@pengutronix.de> From: Bartosz Golaszewski Date: Wed, 11 Dec 2019 10:30:33 +0100 Message-ID: Subject: Re: [PATCH v3 2/2] gpio: bcm-kona: use platform_irq_count To: =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= Cc: Peng Fan , "rjui@broadcom.com" , "linus.walleij@linaro.org" , "f.fainelli@gmail.com" , "sbranden@broadcom.com" , "thierry.reding@gmail.com" , "robh@kernel.org" , "bcm-kernel-feedback-list@broadcom.com" , dl-linux-imx , "linux-gpio@vger.kernel.org" , "linux-pwm@vger.kernel.org" , "linux-kernel@vger.kernel.org" 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 =C5=9Br., 4 gru 2019 o 11:09 Uwe Kleine-K=C3=B6nig napisa=C5=82(a): > > On Wed, Dec 04, 2019 at 09:24:39AM +0000, Peng Fan wrote: > > From: Peng Fan > > > > platform_irq_count() is the more generic way (independent of > > device trees) to determine the count of available interrupts. So > > use this instead. > > > > As platform_irq_count() might return an error code (which > > of_irq_count doesn't) some additional handling is necessary. > > > > Signed-off-by: Peng Fan > > --- > > > > V3: > > Use %pe > > Great. Note that with %pe there is a dependency on commit 57f5677e535b > ("printf: add support for printing symbolic error names") which was > applied during the current merge window. > Why would %pe be better in this case? The function returned an int - why convert it to a pointer? Bart > > V2: > > Update commit log, and add err handling > > Not tested, just code inspection > > > > > > drivers/gpio/gpio-bcm-kona.c | 12 +++++++++--- > > 1 file changed, 9 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.= c > > index 4122683eb1f9..baee8c3f06ad 100644 > > --- a/drivers/gpio/gpio-bcm-kona.c > > +++ b/drivers/gpio/gpio-bcm-kona.c > > @@ -19,7 +19,6 @@ > > #include > > #include > > #include > > -#include > > #include > > #include > > #include > > @@ -586,11 +585,18 @@ static int bcm_kona_gpio_probe(struct platform_de= vice *pdev) > > > > kona_gpio->gpio_chip =3D template_chip; > > chip =3D &kona_gpio->gpio_chip; > > - kona_gpio->num_bank =3D of_irq_count(dev->of_node); > > - if (kona_gpio->num_bank =3D=3D 0) { > > + ret =3D platform_irq_count(pdev); > > + if (!ret) { > > dev_err(dev, "Couldn't determine # GPIO banks\n"); > > return -ENOENT; > > + } else if (ret < 0) { > > + if (ret !=3D -EPROBE_DEFER) > > + dev_err(dev, "Couldn't determine GPIO banks: (%pe= )\n", > > + ERR_PTR(ret)); > > I'd say drop either the colon or the parenthesis. > > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-K=C3=B6nig = | > Industrial Linux Solutions | https://www.pengutronix.de/ = |