linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
	 Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	 Christophe Leroy <christophe.leroy@csgroup.eu>,
	 Naveen N Rao <naveen@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	 Bartosz Golaszewski <brgl@bgdev.pl>,
	Anatolij Gustschin <agust@denx.de>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	 linux-gpio@vger.kernel.org,
	 Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH 1/5] powerpc: sysdev/gpio: use new line value setter callbacks
Date: Tue, 08 Apr 2025 09:21:09 +0200	[thread overview]
Message-ID: <20250408-gpiochip-set-rv-powerpc-v1-1-73dc1ebc6ef1@linaro.org> (raw)
In-Reply-To: <20250408-gpiochip-set-rv-powerpc-v1-0-73dc1ebc6ef1@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>
---
 arch/powerpc/sysdev/cpm_common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c
index 47db732981a8..e22fc638dbc7 100644
--- a/arch/powerpc/sysdev/cpm_common.c
+++ b/arch/powerpc/sysdev/cpm_common.c
@@ -138,7 +138,7 @@ static void __cpm2_gpio32_set(struct of_mm_gpio_chip *mm_gc, u32 pin_mask,
 	out_be32(&iop->dat, cpm2_gc->cpdata);
 }
 
-static void cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value)
+static int cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value)
 {
 	struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
 	struct cpm2_gpio32_chip *cpm2_gc = gpiochip_get_data(gc);
@@ -150,6 +150,8 @@ static void cpm2_gpio32_set(struct gpio_chip *gc, unsigned int gpio, int value)
 	__cpm2_gpio32_set(mm_gc, pin_mask, value);
 
 	spin_unlock_irqrestore(&cpm2_gc->lock, flags);
+
+	return 0;
 }
 
 static int cpm2_gpio32_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
@@ -208,7 +210,7 @@ int cpm2_gpiochip_add32(struct device *dev)
 	gc->direction_input = cpm2_gpio32_dir_in;
 	gc->direction_output = cpm2_gpio32_dir_out;
 	gc->get = cpm2_gpio32_get;
-	gc->set = cpm2_gpio32_set;
+	gc->set_rv = cpm2_gpio32_set;
 	gc->parent = dev;
 	gc->owner = THIS_MODULE;
 

-- 
2.45.2


  reply	other threads:[~2025-04-08  7:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  7:21 [PATCH 0/5] powerpc: convert board-file GPIO chips to using new value setters Bartosz Golaszewski
2025-04-08  7:21 ` Bartosz Golaszewski [this message]
2025-04-30 17:35   ` [PATCH 1/5] powerpc: sysdev/gpio: use new line value setter callbacks Christophe Leroy
2025-04-08  7:21 ` [PATCH 2/5] powerpc: 83xx/gpio: " Bartosz Golaszewski
2025-04-30 17:33   ` Christophe Leroy
2025-04-30 17:37     ` Bartosz Golaszewski
2025-04-30 17:47       ` Christophe Leroy
2025-04-30 17:48         ` Bartosz Golaszewski
2025-04-08  7:21 ` [PATCH 3/5] powerpc: 44x/gpio: " Bartosz Golaszewski
2025-04-30 17:35   ` Christophe Leroy
2025-04-08  7:21 ` [PATCH 4/5] powerpc: 52xx/gpio: " Bartosz Golaszewski
2025-04-30 17:35   ` Christophe Leroy
2025-04-08  7:21 ` [PATCH 5/5] powerpc: 8xx/gpio: " Bartosz Golaszewski
2025-04-30 17:36   ` Christophe Leroy
2025-04-23 15:15 ` [PATCH 0/5] powerpc: convert board-file GPIO chips to using new value setters Bartosz Golaszewski
2025-04-24  8:53 ` 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=20250408-gpiochip-set-rv-powerpc-v1-1-73dc1ebc6ef1@linaro.org \
    --to=brgl@bgdev.pl \
    --cc=agust@denx.de \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.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).