linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
	 Bartosz Golaszewski <brgl@bgdev.pl>,
	Andy Shevchenko <andy@kernel.org>,
	 Orson Zhai <orsonzhai@gmail.com>,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	 Chunyan Zhang <zhang.lyra@gmail.com>,
	 Robert Jarzmik <robert.jarzmik@free.fr>,
	Heiko Stuebner <heiko@sntech.de>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org,
	 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH v2 01/12] gpio: pca9570: use new GPIO line value setter callbacks
Date: Thu, 19 Jun 2025 10:33:14 +0200	[thread overview]
Message-ID: <20250619-gpiochip-set-rv-gpio-v2-1-74abf689fbd8@linaro.org> (raw)
In-Reply-To: <20250619-gpiochip-set-rv-gpio-v2-0-74abf689fbd8@linaro.org>

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. Convert the driver to using
them.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/gpio-pca9570.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-pca9570.c b/drivers/gpio/gpio-pca9570.c
index d37ba404936835bca160822ee361604827976e9b..a33246f20fd838a57abeedbbd7e58259bf073a86 100644
--- a/drivers/gpio/gpio-pca9570.c
+++ b/drivers/gpio/gpio-pca9570.c
@@ -88,7 +88,7 @@ static int pca9570_get(struct gpio_chip *chip, unsigned offset)
 	return !!(buffer & BIT(offset));
 }
 
-static void pca9570_set(struct gpio_chip *chip, unsigned offset, int value)
+static int pca9570_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
 	struct pca9570 *gpio = gpiochip_get_data(chip);
 	u8 buffer;
@@ -110,6 +110,7 @@ static void pca9570_set(struct gpio_chip *chip, unsigned offset, int value)
 
 out:
 	mutex_unlock(&gpio->lock);
+	return ret;
 }
 
 static int pca9570_probe(struct i2c_client *client)
@@ -125,7 +126,7 @@ static int pca9570_probe(struct i2c_client *client)
 	gpio->chip.owner = THIS_MODULE;
 	gpio->chip.get_direction = pca9570_get_direction;
 	gpio->chip.get = pca9570_get;
-	gpio->chip.set = pca9570_set;
+	gpio->chip.set_rv = pca9570_set;
 	gpio->chip.base = -1;
 	gpio->chip_data = device_get_match_data(&client->dev);
 	gpio->chip.ngpio = gpio->chip_data->ngpio;

-- 
2.48.1



  reply	other threads:[~2025-06-19  8:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19  8:33 [PATCH v2 00/12] gpio: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-06-19  8:33 ` Bartosz Golaszewski [this message]
2025-06-19  8:33 ` [PATCH v2 02/12] gpio: pcf857x: " Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 03/12] gpio: pch: " Bartosz Golaszewski
2025-06-19  8:34   ` Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 04/12] gpio: pl061: " Bartosz Golaszewski
2025-06-19  8:35   ` Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 05/12] gpio: pmic-eic-sprd: drop unneeded .set() callback Bartosz Golaszewski
2025-06-19  8:36   ` Bartosz Golaszewski
2025-06-19  8:53     ` Heiko Stuebner
2025-06-19  8:58   ` Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 06/12] gpio: pxa: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 07/12] gpio: rc5t583: " Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 08/12] gpio: rdc321x: " Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 09/12] gpio: reg: " Bartosz Golaszewski
2025-06-19 14:34   ` Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 10/12] gpio: rockchip: " Bartosz Golaszewski
2025-06-19  8:54   ` Heiko Stuebner
2025-06-19  8:33 ` [PATCH v2 11/12] gpio: rtd: " Bartosz Golaszewski
2025-06-19  8:33 ` [PATCH v2 12/12] gpio: sa1100: " Bartosz Golaszewski
2025-06-23  7:27 ` (subset) [PATCH v2 00/12] gpio: " Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250619-gpiochip-set-rv-gpio-v2-1-74abf689fbd8@linaro.org \
    --to=brgl@bgdev.pl \
    --cc=andy@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=heiko@sntech.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=orsonzhai@gmail.com \
    --cc=robert.jarzmik@free.fr \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).