From: Bartosz Golaszewski <brgl@bgdev.pl>
To: "Santosh Kumar Yadav" <santoshkumar.yadav@barco.com>,
"Peter Korsgaard" <peter.korsgaard@barco.com>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>
Cc: platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 1/3] platform/x86: barco-p50: use new GPIO line value setter callbacks
Date: Tue, 08 Apr 2025 09:19:53 +0200 [thread overview]
Message-ID: <20250408-gpiochip-set-rv-platform-x86-v1-1-6f67e76a722c@linaro.org> (raw)
In-Reply-To: <20250408-gpiochip-set-rv-platform-x86-v1-0-6f67e76a722c@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/platform/x86/barco-p50-gpio.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/barco-p50-gpio.c b/drivers/platform/x86/barco-p50-gpio.c
index 143d14548565..bb3393bbfb89 100644
--- a/drivers/platform/x86/barco-p50-gpio.c
+++ b/drivers/platform/x86/barco-p50-gpio.c
@@ -268,15 +268,19 @@ static int p50_gpio_get(struct gpio_chip *gc, unsigned int offset)
return ret;
}
-static void p50_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
+static int p50_gpio_set(struct gpio_chip *gc, unsigned int offset, int value)
{
struct p50_gpio *p50 = gpiochip_get_data(gc);
+ int ret;
mutex_lock(&p50->lock);
- p50_send_mbox_cmd(p50, P50_MBOX_CMD_WRITE_GPIO, gpio_params[offset], value);
+ ret = p50_send_mbox_cmd(p50, P50_MBOX_CMD_WRITE_GPIO,
+ gpio_params[offset], value);
mutex_unlock(&p50->lock);
+
+ return ret;
}
static int p50_gpio_probe(struct platform_device *pdev)
@@ -312,7 +316,7 @@ static int p50_gpio_probe(struct platform_device *pdev)
p50->gc.base = -1;
p50->gc.get_direction = p50_gpio_get_direction;
p50->gc.get = p50_gpio_get;
- p50->gc.set = p50_gpio_set;
+ p50->gc.set_rv = p50_gpio_set;
/* reset mbox */
--
2.45.2
next prev parent reply other threads:[~2025-04-08 7:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 7:19 [PATCH 0/3] platform/x86: convert GPIO chips to using new value setters Bartosz Golaszewski
2025-04-08 7:19 ` Bartosz Golaszewski [this message]
2025-04-08 7:24 ` [PATCH 1/3] platform/x86: barco-p50: use new GPIO line value setter callbacks Korsgaard, Peter
2025-04-08 7:19 ` [PATCH 2/3] platform/x86: int0002: " Bartosz Golaszewski
2025-04-08 7:19 ` [PATCH 3/3] platform/x86: silicom: " Bartosz Golaszewski
2025-04-08 8:50 ` [PATCH 0/3] platform/x86: convert GPIO chips to using new value setters Hans de Goede
2025-04-11 12:24 ` Ilpo Järvinen
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=20250408-gpiochip-set-rv-platform-x86-v1-1-6f67e76a722c@linaro.org \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.korsgaard@barco.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=santoshkumar.yadav@barco.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).