Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp62622ybn; Thu, 3 Oct 2019 01:26:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYjUJTvuN/CPTH8eyf/DF1Dk2oiAwna1JLHg7/Pc3us3mEOp5uYaP9Th7h2+CyqWEKTqqz X-Received: by 2002:a50:ec81:: with SMTP id e1mr8214841edr.107.1570091176495; Thu, 03 Oct 2019 01:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570091176; cv=none; d=google.com; s=arc-20160816; b=I/Ds1/D5XwbKKQIKsSBWODt+wrpOXzCF4TnZk/50dk7aZZYeBd01g0DFEjB4YuI3YI zJfvptaN7onBzhjreEri7IoIy0pZkxIoTQD9zYlkEJB+HU/YONqirqo5fLW6QlBZt2+l UarsRbeGkg3erGo+o/xU+Wsjt86J3S4j+yjqBdK21F+8o6ib+40ZSbgPT2wousThR1oC 2vIbTRtIHr0wMMmjSbgZbIVwoKQz59zwL/bLXnStUkB3Jj1lw/+4IfTUVgUKu33nshLg uOk0I53DZV8WSS+PTmr6Ic4Lk+wjmP/KtLnBo4Eq3db3GHe3TNbL7WOXXEnXdBikERdf YSoA== 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=zUA3u1BSXrY9Ik2AcFkwsTNlxrkAsn7Y3a8AWnLHJCs=; b=digHxLkzA+OtPUc/7TdBFbDZIkftvxSK/mY7ZFgDILz1EfAnL+ZKas5VmzhLfsP9FY RMkJebn9pY+zkMZ0OxqgCI1vNxBK1KIRLSWlsRztYWcnTtDBECk29h5IVNijzzuJ7Z9k GJnoE1q2LW6Pr54oEs/U4wBFXOzhtlVDnXOiBq66eyEcg+Vc4UypStyzAZQMWtziRueU wg6g8j9b5gVtRq+cVFyyYzH9G7RiKXG/FUnbCoIi7pFR1KWh4gx4vQVpT49af7cOVrLz GhVj8nbEw32BIX8/lEfbcYH++RRSIzOb5joEvyUH2LOBQgVcdHf2rD+1LrksZZDYeFYw tsKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="h8H/vn0s"; 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 jx7si829567ejb.84.2019.10.03.01.25.51; Thu, 03 Oct 2019 01:26:16 -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="h8H/vn0s"; 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 S1728114AbfJCIYe (ORCPT + 99 others); Thu, 3 Oct 2019 04:24:34 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:44664 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727832AbfJCIYd (ORCPT ); Thu, 3 Oct 2019 04:24:33 -0400 Received: by mail-oi1-f194.google.com with SMTP id w6so1778555oie.11 for ; Thu, 03 Oct 2019 01:24: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=zUA3u1BSXrY9Ik2AcFkwsTNlxrkAsn7Y3a8AWnLHJCs=; b=h8H/vn0shPR2AQlVRPOxIV+d0a78GeWR741CrWoHLD3dQOd8vPoKvYNHrJKMbaehoQ g+1ZWq8e7ceYDz55w85Fq4ItKbhbWp/wBG5z0dxFFSzCndVZDS0eWZgKNcEQ8I/t2Z4n JHWrq7ZA11DmqXcrylhwOdrOoQc+XOOyedUM2kThILG39klPkX7nDWG2jx5TLwThdjbJ vHiC8Ht83H6rHcZ7sig02tHHEr+IARV+x142dHmtqsyVvPunKJ7XYEPpTxnKRXUkLpbX RNnMVyfBJjzVQigFX1u4VrbZAcorMoOXxBQsu9VamHRjxWNY+dWfNEviJOPqMg3m5OJT LrMQ== 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=zUA3u1BSXrY9Ik2AcFkwsTNlxrkAsn7Y3a8AWnLHJCs=; b=Eo0ngEnMCf7lggcw3CHhctmHdLS/kHzr7k9EKn5ZSJUVlFu9qhC9nvD65rO/Wf3IJo IH3IQWjjKAfdd/xTagxqvv72cSssAWhWC5X/rwdqDKrZO/Kkp+G/MJHYrmYNkR9dHO4w Km7Ih0hYG8BQUXV7HiayByZRCqQCzPEHCnQc/wsJ3rJH4qJNyuxTcIERy8vsDFE9YyYR v5iRUsZfnSR0EXWDGwUeASFahjuYKVH4V7wHD9RcxiagVPgI0ta0RCLTuezTJFzIdMPf FgREhezj5J+rlaBZ41aSOK5khBQZjdH34tpbNqGd/Eu6ae03L20IIl0+nrTCaAlJjL+m CpsA== X-Gm-Message-State: APjAAAWNzuuMYdbDWSGoq2zKBFcJe4yEGDvM9CbVVQ6ULZubESik7QSF A6//UffITbY8CmzS76IHx1m+Ul5wIzbI84olTYzZiQ== X-Received: by 2002:a54:4f8a:: with SMTP id g10mr1908892oiy.147.1570091072850; Thu, 03 Oct 2019 01:24:32 -0700 (PDT) MIME-Version: 1.0 References: <20190927100407.1863293-1-paul.kocialkowski@bootlin.com> <20190927100407.1863293-4-paul.kocialkowski@bootlin.com> In-Reply-To: <20190927100407.1863293-4-paul.kocialkowski@bootlin.com> From: Bartosz Golaszewski Date: Thu, 3 Oct 2019 10:24: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 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 offset); > + void (*set)(struct gpio_chip *chip, unsigned offset, > + int value); Why did you change this line? Doesn't seem necessary and pollutes the histo= ry. Bart > }; > > struct syscon_gpio_priv { > @@ -252,7 +253,7 @@ static int syscon_gpio_probe(struct platform_device *= 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 >