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>,
	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 11/12] gpio: mc33880: use new GPIO line value setter callbacks
Date: Tue, 06 May 2025 11:01:54 +0200	[thread overview]
Message-ID: <20250506-gpiochip-set-rv-gpio-part3-v1-11-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-mc33880.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c
index 5fb357d7b78aa..e689561041616 100644
--- a/drivers/gpio/gpio-mc33880.c
+++ b/drivers/gpio/gpio-mc33880.c
@@ -57,15 +57,18 @@ static int __mc33880_set(struct mc33880 *mc, unsigned offset, int value)
 }
 
 
-static void mc33880_set(struct gpio_chip *chip, unsigned offset, int value)
+static int mc33880_set(struct gpio_chip *chip, unsigned int offset, int value)
 {
 	struct mc33880 *mc = gpiochip_get_data(chip);
+	int ret;
 
 	mutex_lock(&mc->lock);
 
-	__mc33880_set(mc, offset, value);
+	ret = __mc33880_set(mc, offset, value);
 
 	mutex_unlock(&mc->lock);
+
+	return ret;
 }
 
 static int mc33880_probe(struct spi_device *spi)
@@ -100,7 +103,7 @@ static int mc33880_probe(struct spi_device *spi)
 	mc->spi = spi;
 
 	mc->chip.label = DRIVER_NAME;
-	mc->chip.set = mc33880_set;
+	mc->chip.set_rv = mc33880_set;
 	mc->chip.base = pdata->base;
 	mc->chip.ngpio = PIN_NUMBER;
 	mc->chip.can_sleep = true;

-- 
2.45.2


  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 ` [PATCH 10/12] gpio: mb86s7x: " Bartosz Golaszewski
2025-05-06  9:01 ` Bartosz Golaszewski [this message]
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-11-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).