From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Vladimir Zapolskiy <vz@mleia.com>,
Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Andy Shevchenko <andy@kernel.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 10/12] gpio: mb86s7x: use new GPIO line value setter callbacks
Date: Tue, 06 May 2025 11:01:53 +0200 [thread overview]
Message-ID: <20250506-gpiochip-set-rv-gpio-part3-v1-10-0fbdea5a9667@linaro.org> (raw)
In-Reply-To: <20250506-gpiochip-set-rv-gpio-part3-v1-0-0fbdea5a9667@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-mb86s7x.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mb86s7x.c b/drivers/gpio/gpio-mb86s7x.c
index 7ee891ef6905c..5ee2991ecdfdd 100644
--- a/drivers/gpio/gpio-mb86s7x.c
+++ b/drivers/gpio/gpio-mb86s7x.c
@@ -119,7 +119,7 @@ static int mb86s70_gpio_get(struct gpio_chip *gc, unsigned gpio)
return !!(readl(gchip->base + PDR(gpio)) & OFFSET(gpio));
}
-static void mb86s70_gpio_set(struct gpio_chip *gc, unsigned gpio, int value)
+static int mb86s70_gpio_set(struct gpio_chip *gc, unsigned int gpio, int value)
{
struct mb86s70_gpio_chip *gchip = gpiochip_get_data(gc);
unsigned long flags;
@@ -135,6 +135,8 @@ static void mb86s70_gpio_set(struct gpio_chip *gc, unsigned gpio, int value)
writel(val, gchip->base + PDR(gpio));
spin_unlock_irqrestore(&gchip->lock, flags);
+
+ return 0;
}
static int mb86s70_gpio_to_irq(struct gpio_chip *gc, unsigned int offset)
@@ -178,7 +180,7 @@ static int mb86s70_gpio_probe(struct platform_device *pdev)
gchip->gc.request = mb86s70_gpio_request;
gchip->gc.free = mb86s70_gpio_free;
gchip->gc.get = mb86s70_gpio_get;
- gchip->gc.set = mb86s70_gpio_set;
+ gchip->gc.set_rv = mb86s70_gpio_set;
gchip->gc.to_irq = mb86s70_gpio_to_irq;
gchip->gc.label = dev_name(&pdev->dev);
gchip->gc.ngpio = 32;
--
2.45.2
next prev parent reply other threads:[~2025-05-06 9:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 9:01 [PATCH 00/12] gpio: convert more GPIO chips to using new value setters - part 3 for v6.16 Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 01/12] gpio: lp873x: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 02/12] gpio: lp87565: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 03/12] gpio: lpc18xx: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 04/12] gpio: lpc32xx: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 05/12] gpio: madera: " Bartosz Golaszewski
2025-05-06 9:20 ` Charles Keepax
2025-05-06 9:01 ` [PATCH 06/12] gpio: max3191x: remove unused callbacks Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 07/12] gpio: max730x: use new GPIO line value setter callbacks Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 08/12] gpio: max732x: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 09/12] gpio: max77620: " Bartosz Golaszewski
2025-05-06 9:01 ` Bartosz Golaszewski [this message]
2025-05-06 9:01 ` [PATCH 11/12] gpio: mc33880: " Bartosz Golaszewski
2025-05-06 9:01 ` [PATCH 12/12] gpio: ml-ioh: " Bartosz Golaszewski
2025-05-07 14:55 ` Andy Shevchenko
2025-05-13 13:15 ` [PATCH 00/12] gpio: convert more GPIO chips to using new value setters - part 3 for v6.16 Bartosz Golaszewski
2025-05-13 13:37 ` Andy Shevchenko
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=20250506-gpiochip-set-rv-gpio-part3-v1-10-0fbdea5a9667@linaro.org \
--to=brgl@bgdev.pl \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=ckeepax@opensource.cirrus.com \
--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-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=piotr.wojtaszczyk@timesys.com \
--cc=rf@opensource.cirrus.com \
--cc=vz@mleia.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).