From: Bartosz Golaszewski <brgl@bgdev.pl>
To: "Basavaraj Natikar" <Basavaraj.Natikar@amd.com>,
"Shyam Sundar S K" <Shyam-sundar.S-k@amd.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>,
"Chen-Yu Tsai" <wens@csie.org>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Andreas Färber" <afaerber@suse.de>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Paul Cercueil" <paul@crapouillou.net>,
"Steen Hegelund" <Steen.Hegelund@microchip.com>,
"Daniel Machon" <daniel.machon@microchip.com>,
UNGLinuxDriver@microchip.com,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Andrew Lunn" <andrew@lunn.ch>,
"Gregory Clement" <gregory.clement@bootlin.com>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Sylwester Nawrocki" <s.nawrocki@samsung.com>,
"Alim Akhtar" <alim.akhtar@samsung.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-actions@lists.infradead.org, linux-mips@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 05/12] pinctrl: stm32: use new GPIO line value setter callbacks
Date: Thu, 24 Apr 2025 10:35:28 +0200 [thread overview]
Message-ID: <20250424-gpiochip-set-rv-pinctrl-part2-v1-5-504f91120b99@linaro.org> (raw)
In-Reply-To: <20250424-gpiochip-set-rv-pinctrl-part2-v1-0-504f91120b99@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/pinctrl/stm32/pinctrl-stm32.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index cc0b4d1d7cff..ba49d48c3a1d 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -228,11 +228,14 @@ static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
return !!(readl_relaxed(bank->base + STM32_GPIO_IDR) & BIT(offset));
}
-static void stm32_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+static int stm32_gpio_set(struct gpio_chip *chip, unsigned int offset,
+ int value)
{
struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
__stm32_gpio_set(bank, offset, value);
+
+ return 0;
}
static int stm32_gpio_direction_output(struct gpio_chip *chip,
@@ -308,7 +311,7 @@ static const struct gpio_chip stm32_gpio_template = {
.request = stm32_gpio_request,
.free = pinctrl_gpio_free,
.get = stm32_gpio_get,
- .set = stm32_gpio_set,
+ .set_rv = stm32_gpio_set,
.direction_input = pinctrl_gpio_direction_input,
.direction_output = stm32_gpio_direction_output,
.to_irq = stm32_gpio_to_irq,
--
2.45.2
next prev parent reply other threads:[~2025-04-24 8:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-24 8:35 [PATCH 00/12] pinctrl: convert GPIO chips to using new value setters - part 2 for v6.16 Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 01/12] pinctrl: amd: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 02/12] pinctrl: axp209: " Bartosz Golaszewski
2025-04-24 17:43 ` Chen-Yu Tsai
2025-04-24 18:55 ` Bartosz Golaszewski
2025-04-29 8:35 ` Linus Walleij
2025-04-24 8:35 ` [PATCH 03/12] pinctrl: stmfx: " Bartosz Golaszewski
2025-04-24 14:59 ` [Linux-stm32] " Amelie Delaunay
2025-04-24 8:35 ` [PATCH 04/12] pinctrl: owl: " Bartosz Golaszewski
2025-04-28 16:07 ` Manivannan Sadhasivam
2025-04-24 8:35 ` Bartosz Golaszewski [this message]
2025-04-24 16:04 ` [Linux-stm32] [PATCH 05/12] pinctrl: stm32: " Antonio Borneo
2025-04-24 8:35 ` [PATCH 06/12] pinctrl: ingenic: " Bartosz Golaszewski
2025-04-24 10:13 ` Paul Cercueil
2025-04-24 8:35 ` [PATCH 07/12] pinctrl: microchip-sgpio: " Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 08/12] pinctrl: at91: allow building the module with COMPILE_TEST=y Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 09/12] pinctrl: at91: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 10/12] pinctrl: armada-37xx: " Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 11/12] pinctrl: pistachio: " Bartosz Golaszewski
2025-04-24 8:35 ` [PATCH 12/12] pinctrl: samsung: " Bartosz Golaszewski
2025-04-27 19:17 ` (subset) " Krzysztof Kozlowski
2025-04-29 8:31 ` [PATCH 00/12] pinctrl: convert GPIO chips to using new value setters - part 2 for v6.16 Linus Walleij
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=20250424-gpiochip-set-rv-pinctrl-part2-v1-5-504f91120b99@linaro.org \
--to=brgl@bgdev.pl \
--cc=Basavaraj.Natikar@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=afaerber@suse.de \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=alim.akhtar@samsung.com \
--cc=andrew@lunn.ch \
--cc=bartosz.golaszewski@linaro.org \
--cc=claudiu.beznea@tuxon.dev \
--cc=daniel.machon@microchip.com \
--cc=gregory.clement@bootlin.com \
--cc=krzk@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-actions@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=ludovic.desroches@microchip.com \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=nicolas.ferre@microchip.com \
--cc=paul@crapouillou.net \
--cc=s.nawrocki@samsung.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=wens@csie.org \
/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).