Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1117283ybl; Tue, 3 Dec 2019 01:55:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwX1f37mnR9mrMOcQNBKU9hLIll68HLFMSxB6+0KgCfPJMwiKWgx6pk2pg/y7qxIrCQAW3s X-Received: by 2002:aca:b38b:: with SMTP id c133mr2774122oif.2.1575366926535; Tue, 03 Dec 2019 01:55:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575366926; cv=none; d=google.com; s=arc-20160816; b=tgpilN41kLhJ02Uzx2OcIWFwIMa/kuwPvFJg1jbqg71yJ4+SIGeL/1Rc099z7n6btq N+OJaUAQEMgDPHOYrqv9QddNswxf6n6CCOMEXy9DhwObim8o8nSfCrqNYOIH8pp6estQ BP3RX39885xTVzg05JmsAvmxrLDOrV/RxLlETwdVheijHMkfrowi8wNELjL5CBMz/ndn mgAMw1r9PnVSk7V7bkgg17b85mQEQhATw2nd0et11SHKmyoQ/71gmIrGVN7c5Q5C/F2K X+0KDEQHUyUsuP1IqQMyki2m70jEA6/3wAfZpHxJVxfe4Jb5muTuvXvnpNBK0V6VUuum YJhA== 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=wVf6LBQRDptqpCKdFOlhcvzs6k4hCdHUr7W60r3qycU=; b=QHpmVfrxQzVoyLVJnjtbigGiJXpWSiiVmxe1pUh+Hk0ESWrR0FytZrzEUqfPOzGUx1 BtK1FNv0x7k32z+p/xJXRdZdJpdsJ6B2rjAfbHh0ivqjnM5FDcMqfphweC5F/n0Tvlpe 5A+KJj51Y9tz4Yem8AsXT5zRdvjt3ZHwhLqqJCmx+2nAaeYRsiaSFM9i3EwEsR/qP6XZ GlbWBQgTCC9oLCASmtck/bbi/5BvOI7JIsvUZ7DT3xC0/26wcr2kW3UrW/0h11anBZx+ 0us/lxA0xS6vh9M7SW/s+o3RH6UQsn5RdHS4e3y1D3dr95JBWn3Nor4p5IQRmxfQjEnG pquw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=oHI6od5e; 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 l19si1003699oib.48.2019.12.03.01.55.14; Tue, 03 Dec 2019 01:55:26 -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=oHI6od5e; 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 S1726107AbfLCJyq (ORCPT + 99 others); Tue, 3 Dec 2019 04:54:46 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:43876 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfLCJyp (ORCPT ); Tue, 3 Dec 2019 04:54:45 -0500 Received: by mail-ot1-f68.google.com with SMTP id p8so2334481oth.10 for ; Tue, 03 Dec 2019 01:54:45 -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=wVf6LBQRDptqpCKdFOlhcvzs6k4hCdHUr7W60r3qycU=; b=oHI6od5exA7qVjlcTCQw0+n2wjli17j/iVzx3noeDCu4V3HzrIlHduDDkCTJP7l/51 Ry07HR27Y9ZPhvbEkcdcVRn4GRv0Ilg6bjPZeZ1v6sNcv/iL9ESjYjNQcKPNpn1nPPeC 7hPKzEG9Az4z+JF9fC6AZaKVkNYlye6V5N54248nxcR+C9v3nN01w3UowIXqgqFbFIaB B17JRFf7i7Mf+SFxRgCVTc8d3eSwBxOxEydyc6OIKc2mrwz6v13GeZ0Saeyb4UV7mybb zgZ8VOs9wtivWXnCOF0udd6eJZeTt5crpeYVX7cysYwwZwpxrnS7lK1TXY3/azMwxDP4 Xfhg== 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=wVf6LBQRDptqpCKdFOlhcvzs6k4hCdHUr7W60r3qycU=; b=QDDozmfd3OyFFJxtGMPns1ffNGpndHqcX+soM9q7N3YQtXpLsDfcVhhMZUY21AAzl5 nVXuIXdrceqDyUVkFqpBVft25jMn3m3jnP4Ez9fSbPxLANTLEBGEgfLwq3YgX3OGV5o/ I5VRMfUiMBpcvz8yTLnu5FOWAjzlae1Lxph1REatu2X3F8cjwNsvrz76MFb+V1usC1vv LW1RfqPkM5k3Di+PZJurkCvPY5fL2V17nopjKPMA4u1ufaQ8dXizFYcVX1yCkDMwJVk2 hmBQzvIChcVuIDaTNahLj25wzrKXZaqaH2t8tgEt06/hu/H2Vsz8xxGZnm0wJIfd5U7k nrrw== X-Gm-Message-State: APjAAAXXa9x17L3niN3wWqEIznNL4iO8655bTH0hatC93+3CcmOQgKk/ RCjCi1aTzBv5j45U7n0pI4Py+JUhGGtQ4qhFkiE82w== X-Received: by 2002:a9d:32e5:: with SMTP id u92mr2574205otb.85.1575366884881; Tue, 03 Dec 2019 01:54:44 -0800 (PST) MIME-Version: 1.0 References: <1575352925-17271-1-git-send-email-peng.fan@nxp.com> <1575352925-17271-2-git-send-email-peng.fan@nxp.com> <20191203065751.w23dypag4745qv7i@pengutronix.de> In-Reply-To: <20191203065751.w23dypag4745qv7i@pengutronix.de> From: Bartosz Golaszewski Date: Tue, 3 Dec 2019 10:54:34 +0100 Message-ID: Subject: Re: [PATCH 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" , Alice Guo 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 wt., 3 gru 2019 o 07:57 Uwe Kleine-K=C3=B6nig napisa=C5=82(a): > > On Tue, Dec 03, 2019 at 06:04:27AM +0000, Peng Fan wrote: > > From: Peng Fan > > > > Use platform_irq_count to replace of_irq_count > > > > Signed-off-by: Peng Fan > > --- > > > > V1: > > Code inspection, not tested > > > > drivers/gpio/gpio-bcm-kona.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.= c > > index 4122683eb1f9..c50721980a7c 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,7 +585,7 @@ static int bcm_kona_gpio_probe(struct platform_devi= ce *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); > > + kona_gpio->num_bank =3D platform_irq_count(pdev); > > of_irq_count returns 0 or a positive int while platform_irq_count might > return a negative error code. This needs handling. Also I wonder why > platform_irq_count() is better than of_irq_count() which would be good > to describe in the commit log. > In general I like drivers to use generic APIs whenever possible. There are a lot of drivers that use some random of_ routines just because the developer didn't know any better and it turns out we now have generic device properties and a lot of platform device helpers. Consolidation is always good. Waiting for v2. > Best regards > Uwe > > -- > Pengutronix e.K. | Uwe Kleine-K=C3=B6nig = | > Industrial Linux Solutions | https://www.pengutronix.de/ = |