Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp478703ybn; Thu, 3 Oct 2019 07:48:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyiSY2/4S2RGOLjkqTOfKFnyF+zGX0SGPQmr4SW9sc/TP4C/os4bWleS3xGv7xtNxySwNGo X-Received: by 2002:a50:91d8:: with SMTP id h24mr9807199eda.61.1570114121935; Thu, 03 Oct 2019 07:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570114121; cv=none; d=google.com; s=arc-20160816; b=mqW9oxwoUVKyfgSnecZ1xagY1rIoazd0BGcbPup29Ehc9Qhq8RmOZ5ORr6BPmjXWCi L8uf4XCydpFIlZ7Vo7pQczxw8P2mV8IQQiY8JFXsqJ20m3+hc2g16lNPOP5EJTtIU27a iI3XdAnvA3rTl3LqGXXENpc39mrB/F1x2JHDiPMIW0QzSGccrv2I0G/YlHTNBlvmNh/c 3TCuVElnqsRAuc3HwU17guwJoel7E96krb0WEcucOyOLMZzxqa6SQziy1VELN5q/MA2V 4eeXhBW/SMgDhDukaaBXNoaeKuxNtE2etFBTSpSXmPbP2rgB+UKLf7X0W9Dm307SsGZa 9rWw== 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=CjkcCbQk4BfKYjIfcsA27jNMdWtxDDNMFITjeJ5N6Yo=; b=XZQ0VymueE6ETwKUIkEOAvcfwzAVGmHU7RMvLqHc9vLa6fOxnWJMJLMHacb2NURauU 3ufye2tv44qgpYT0yF8dfywaS0BBGwwXlNlBWH2s5iQ52rDQlfEkweUwcfZQxbKLv9WL IE/txFgsse2YlxiMoxljtcmqN9Y74kNu8ZPqlKR5y+vYj5Dy+Co+Bh5fn2OwcJBp6uet Owv2zMriZpo7gn17H8WizJAjCWlMxIA5bhHEGzFmwD841raNmws2rJ32Qp5Kb0QyWFGq txYX4SyDYr6tdWze9/1a5xnGm088h944lACKVWQm59/kFKstf1AOnoN16ZBK+8wqZMa5 20Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=YOXOx+Tp; 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 w20si1668332edc.202.2019.10.03.07.48.16; Thu, 03 Oct 2019 07:48:41 -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=YOXOx+Tp; 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 S1730077AbfJCOFe (ORCPT + 99 others); Thu, 3 Oct 2019 10:05:34 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:45617 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729535AbfJCOFe (ORCPT ); Thu, 3 Oct 2019 10:05:34 -0400 Received: by mail-ot1-f66.google.com with SMTP id 41so2345768oti.12 for ; Thu, 03 Oct 2019 07:05:33 -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=CjkcCbQk4BfKYjIfcsA27jNMdWtxDDNMFITjeJ5N6Yo=; b=YOXOx+TpchFlAH//++YWGEZLm1lokUcPLph2RU/Nu9ijloryGxTZofWrIGe7Ku03q1 Tzs93SvjWVnXX4Ix9pEmfQIydneey+OnWoUywuxD3xJQPit7fR4RUkv3aCY0Kc+nZUxm 74IRyYDFNglOCzz0yKXO9ne/egBQUOI6ITzGRMC12TIdQSjjilUgUphdDgCgCpck92wN r2cHZIFAaEc1uAzwLfz4edoSRcU/EkpLCUMNfxMbwb1NTL3TEaklMlhG+jHSbZ0c5eHH 9NjN3q0urk1H//CSeEOj3BexelnRhpkPQ8G+WhdF02b5vB5+lmVLGU4A1NMUd2nN6D4Q Q0cw== 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=CjkcCbQk4BfKYjIfcsA27jNMdWtxDDNMFITjeJ5N6Yo=; b=s8XgFyP+R/2Lev1tp0uV2wtyH3xWV9yqgy78oNG1pAzPcG14JT+gM9KHaB+Ghj4c0r BeFxa8V5rg2nO10dk1gg0YQWng9OIOH2MC/Vbvl7aQ1eyD+pp3YDlqa3ooygcIewbML+ VqlhJZD9qZKmp4yFNWKspPcBd/jOCTBMYc2hqSlaGYc0breSTfmPmXq2WztcgLydibks 78Y6vd49bH8obSq3P+Sd1zm7oR7ME7En2sSEvB47AYkoFY1C2kKVPOG3+zV2rERI4Dww POoaBsyprq/aBzwW0QJP2gFxxaAd7d0WqF4/jTWWGYr1Bk1PP2HnPf5V8rb1E5PuLODo /oDA== X-Gm-Message-State: APjAAAWcc1Xy4wM+RtSQkpjLaUHu0pF/834eHAOt9HWBDN5htBG+I9mo On14ddMBjDnnNNzuWpO9POe88Z7vXZfsxkPKrpVteA== X-Received: by 2002:a05:6830:609:: with SMTP id w9mr6937958oti.292.1570111533275; Thu, 03 Oct 2019 07:05:33 -0700 (PDT) MIME-Version: 1.0 References: <20190927100407.1863293-1-paul.kocialkowski@bootlin.com> <20190927100407.1863293-4-paul.kocialkowski@bootlin.com> <20191003112610.GA28856@aptenodytes> In-Reply-To: <20191003112610.GA28856@aptenodytes> From: Bartosz Golaszewski Date: Thu, 3 Oct 2019 16:05:22 +0200 Message-ID: Subject: Re: [PATCH v3 3/5] gpio: syscon: Add support for a custom get operation To: Paul Kocialkowski Cc: linux-gpio , linux-devicetree , LKML , Linus Walleij , Rob Herring , Mark Rutland , Lee Jones , Thomas Petazzoni 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., 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 offse= t); > > > + void (*set)(struct gpio_chip *chip, unsigned offse= t, > > > + int value); > > > > Why did you change this line? Doesn't seem necessary and pollutes the h= istory. > > This is for consistency since both the "chip" and "offset" arguments can = fit > in a single line. Since I want the "get" addition to fit in a single line= , > bringing back "offset" on the previous line of "set" makes things consist= ent. > 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. > 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. Bart > Cheers, > > Paul > > > Bart > > > > > }; > > > > > > struct syscon_gpio_priv { > > > @@ -252,7 +253,7 @@ static int syscon_gpio_probe(struct platform_devi= ce *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