linux-gpio.vger.kernel.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>,
	Shawn Guo <shawnguo@kernel.org>,
	 Sascha Hauer <s.hauer@pengutronix.de>,
	 Pengutronix Kernel Team <kernel@pengutronix.de>,
	 Fabio Estevam <festevam@gmail.com>,
	Lixu Zhang <lixu.zhang@intel.com>,
	 Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Yinbo Zhu <zhuyinbo@loongson.cn>
Cc: linux-gpio@vger.kernel.org, imx@lists.linux.dev,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 06/12] gpio: janz-ttl: use new line value setter callbacks
Date: Wed, 23 Apr 2025 09:15:08 +0200	[thread overview]
Message-ID: <20250423-gpiochip-set-rv-gpio-part2-v1-6-b22245cde81a@linaro.org> (raw)
In-Reply-To: <20250423-gpiochip-set-rv-gpio-part2-v1-0-b22245cde81a@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-janz-ttl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c
index cdf50e4ea165..9f548eda3888 100644
--- a/drivers/gpio/gpio-janz-ttl.c
+++ b/drivers/gpio/gpio-janz-ttl.c
@@ -76,7 +76,7 @@ static int ttl_get_value(struct gpio_chip *gpio, unsigned offset)
 	return !!ret;
 }
 
-static void ttl_set_value(struct gpio_chip *gpio, unsigned offset, int value)
+static int ttl_set_value(struct gpio_chip *gpio, unsigned int offset, int value)
 {
 	struct ttl_module *mod = dev_get_drvdata(gpio->parent);
 	void __iomem *port;
@@ -103,6 +103,8 @@ static void ttl_set_value(struct gpio_chip *gpio, unsigned offset, int value)
 
 	iowrite16be(*shadow, port);
 	spin_unlock(&mod->lock);
+
+	return 0;
 }
 
 static void ttl_write_reg(struct ttl_module *mod, u8 reg, u16 val)
@@ -169,7 +171,7 @@ static int ttl_probe(struct platform_device *pdev)
 	gpio->parent = &pdev->dev;
 	gpio->label = pdev->name;
 	gpio->get = ttl_get_value;
-	gpio->set = ttl_set_value;
+	gpio->set_rv = ttl_set_value;
 	gpio->owner = THIS_MODULE;
 
 	/* request dynamic allocation */

-- 
2.45.2


  parent reply	other threads:[~2025-04-23  7:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23  7:15 [PATCH 00/12] gpio: convert more GPIO chips to using new value setters - part 2 for v6.16 Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 01/12] gpio: imx-scu: don't check the GPIO range Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 02/12] gpio: imx-scu: use lock guards Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 03/12] gpio: imx-scu: destroy the mutex in detach path Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 04/12] gpio: imx-scu: use new line value setter callbacks Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 05/12] gpio: it87: " Bartosz Golaszewski
2025-12-07  4:55   ` Daniel Gibson
2025-12-08  4:48     ` Bartosz Golaszewski
2025-12-08 20:48       ` Daniel Gibson
2025-04-23  7:15 ` Bartosz Golaszewski [this message]
2025-04-23  7:15 ` [PATCH 07/12] gpio: kempld: " Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 08/12] gpio: ljca: " Bartosz Golaszewski
2025-04-23  7:28   ` Sakari Ailus
2025-04-23  7:15 ` [PATCH 09/12] gpio: logicvc: " Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 10/12] gpio: loongson-64bit: " Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 11/12] gpio: loongson: " Bartosz Golaszewski
2025-04-23  7:15 ` [PATCH 12/12] gpio: lp3943: " Bartosz Golaszewski
2025-04-23 10:58 ` [PATCH 00/12] gpio: convert more GPIO chips to using new value setters - part 2 for v6.16 Linus Walleij
2025-04-28 12:23 ` Peng Fan
2025-04-30  8:28 ` 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=20250423-gpiochip-set-rv-gpio-part2-v1-6-b22245cde81a@linaro.org \
    --to=brgl@bgdev.pl \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.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=lixu.zhang@intel.com \
    --cc=s.hauer@pengutronix.de \
    --cc=sakari.ailus@linux.intel.com \
    --cc=shawnguo@kernel.org \
    --cc=zhuyinbo@loongson.cn \
    /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).