Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp482077ybn; Thu, 3 Oct 2019 07:51:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwg08uEzztxKNr951Weymbp305vHQSLZ9j0D+ixe4OF6UGQHItapF7lBYXrR5J3PKUNsME X-Received: by 2002:a50:e718:: with SMTP id a24mr10012814edn.289.1570114302951; Thu, 03 Oct 2019 07:51:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570114302; cv=none; d=google.com; s=arc-20160816; b=ivEyc4yEKLySteLTi/d0EL05XnL+x/MNMXURVzMbnGV78V+Cr8Htpl4mPsUiSYdRvE JRpi2jL/oebAZ9sYhCEw3WJaIULjLixM2dUyC8tL010GPKaPcOvnNG/mPDEOWkNJUAsd NJwOTaMYtfo5LpsLkvTuk2/Ir5+z11IETPpIVeZW8fyo3P9aBtk2D3Zdx442e07TQv7+ 6iY0Y6P33+LSnYxIG4eNwj56ojyFU/iRvwJOtMB8UbXW9mlzZEDzo8gOQJaG7hf2waQd J5usZd4oq8nXL2jBHE8ibk1xiPstZIaJ3I02AXjo8nCOhCGuhQFh4XroM5OJvb8RzMhQ r8Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jkt5pWa/Z7LnxqENZfPx79o9QDgJTQg6D9aU3TmeNLY=; b=IPYLot9P0A/AU1W7mxrX3/R8+kZW1+n4i4ocb+ccW/iQ8i/vTtY8wTe1byDB+pQRa8 EGAdx51qEUgl/hCW8aj+PpcLC9TI6xIK1xKoh18qGgZJvtRMN8jpPE94v2LBDwEbYExs YCX7yU1UMnroaqW4yjiC17oS7C6yYHwg0f/sUB9Seh3vxotfSMWh5rXRCC0meET8nB7G V9diRXubQXg2mVUamKDCpsU1iCyqIVL3ealmlJO/b4sHbmcHuOvPmmgxhVwBuSL56NyX er685WNxc1AiHAHx+Lq5/lZsehIG10SwNzmTsQcf9bYoUxXNjmMRuqOBQV/aQIJFvCVc W09A== ARC-Authentication-Results: i=1; mx.google.com; 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 p14si1425941ejn.192.2019.10.03.07.51.17; Thu, 03 Oct 2019 07:51:42 -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; 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 S1730504AbfJCOPo (ORCPT + 99 others); Thu, 3 Oct 2019 10:15:44 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53959 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730454AbfJCOPo (ORCPT ); Thu, 3 Oct 2019 10:15:44 -0400 X-Originating-IP: 132.205.229.212 Received: from aptenodytes (unknown [132.205.229.212]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 9BCCEFF807; Thu, 3 Oct 2019 14:15:39 +0000 (UTC) Date: Thu, 3 Oct 2019 10:15:37 -0400 From: Paul Kocialkowski To: Bartosz Golaszewski Cc: linux-gpio , linux-devicetree , LKML , Linus Walleij , Rob Herring , Mark Rutland , Lee Jones , Thomas Petazzoni Subject: Re: [PATCH v3 3/5] gpio: syscon: Add support for a custom get operation Message-ID: <20191003141537.GE24151@aptenodytes> References: <20190927100407.1863293-1-paul.kocialkowski@bootlin.com> <20190927100407.1863293-4-paul.kocialkowski@bootlin.com> <20191003112610.GA28856@aptenodytes> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TD8GDToEDw0WLGOL" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --TD8GDToEDw0WLGOL Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu 03 Oct 19, 16:05, Bartosz Golaszewski wrote: > czw., 3 pa=C5=BA 2019 o 13:26 Paul Kocialkowski > napisa=C5=82(a): > > > > Hi, > > > > On Thu 03 Oct 19, 10:24, Bartosz Golaszewski wrote: > > > pt., 27 wrz 2019 o 12:04 Paul Kocialkowski > > > napisa=C5=82(a): > > > > > > > > Some drivers might need a custom get operation to match custom > > > > behavior implemented in the set operation. > > > > > > > > Add plumbing for supporting that. > > > > > > > > Signed-off-by: Paul Kocialkowski > > > > --- > > > > drivers/gpio/gpio-syscon.c | 7 ++++--- > > > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c > > > > index 31f332074d7d..05c537ed73f1 100644 > > > > --- a/drivers/gpio/gpio-syscon.c > > > > +++ b/drivers/gpio/gpio-syscon.c > > > > @@ -43,8 +43,9 @@ struct syscon_gpio_data { > > > > unsigned int bit_count; > > > > unsigned int dat_bit_offset; > > > > unsigned int dir_bit_offset; > > > > - void (*set)(struct gpio_chip *chip, > > > > - unsigned offset, int value); > > > > + int (*get)(struct gpio_chip *chip, unsigned off= set); > > > > + void (*set)(struct gpio_chip *chip, unsigned off= set, > > > > + int value); > > > > > > Why did you change this line? Doesn't seem necessary and pollutes the= history. > > > > This is for consistency since both the "chip" and "offset" arguments ca= n fit > > in a single line. Since I want the "get" addition to fit in a single li= ne, > > bringing back "offset" on the previous line of "set" makes things consi= stent. > > There's probably no particular reason for the split in the first place. > > > > Do you think it needs a separate cosmetic commit only for that? > > I'd rather add a note in the commit message and keep the change as-is. > > >=20 > The line is still broken - just in a different place. I'd prefer to > leave it as it is frankly, there's nothing wrong with it. The point is rather that this introduces inconsistency between the two line= s. It's definitely not a major issue, but I still believe it is a coding style issue. It surely doesn't hurt to fix it. Cheers, Paul > Bart >=20 > > Cheers, > > > > Paul > > > > > Bart > > > > > > > }; > > > > > > > > struct syscon_gpio_priv { > > > > @@ -252,7 +253,7 @@ static int syscon_gpio_probe(struct platform_de= vice *pdev) > > > > priv->chip.label =3D dev_name(dev); > > > > priv->chip.base =3D -1; > > > > priv->chip.ngpio =3D priv->data->bit_count; > > > > - priv->chip.get =3D syscon_gpio_get; > > > > + priv->chip.get =3D priv->data->get ? : syscon_gpio_get; > > > > if (priv->data->flags & GPIO_SYSCON_FEAT_IN) > > > > priv->chip.direction_input =3D syscon_gpio_dir_in; > > > > if (priv->data->flags & GPIO_SYSCON_FEAT_OUT) { > > > > -- > > > > 2.23.0 > > > > > > > > -- > > Paul Kocialkowski, Bootlin > > Embedded Linux and kernel engineering > > https://bootlin.com --TD8GDToEDw0WLGOL Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAl2WAokACgkQ3cLmz3+f v9FNqQgAjU19Rf3TG//SDczLv2Sv0l+hsFLxHpRmO+JvfFeZ72FxUnUAY4VhUfqn ThnnBkKBtQYBEGZCagM7DCUGWUr3z6wxIF6IPlUMmHC8tbemBRx3aX95Yer2MVVd m2/BpErSNNfdjbYPcRumpCFbOUXQJ0JxTLP7Aw1kDh8OkLI81q+tL4Klhs+19vaw wAFbf1CenAEJQlDzlqE2IAN+45h6cuMQSgLRYsZ5ahggs+gE9reX57Dk++xSSK/k LMG6ZiNY0Xxqxv+TJ8VQnu0OtJeAVgrrWWc1eFg6dc8aFNy5jFbMvLfz90iR4Lc1 OqiWTc0Bfpd2Ef2oa20KCEUCVmmqjw== =/Q2n -----END PGP SIGNATURE----- --TD8GDToEDw0WLGOL--