mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] platform/x86: silicom: remove unnecessary GPIO line direction check
@ 2025-06-12  7:48 Bartosz Golaszewski
  2025-06-13 10:14 ` Ilpo Järvinen
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2025-06-12  7:48 UTC (permalink / raw)
  To: Hans de Goede, Ilpo Järvinen, Linus Walleij
  Cc: platform-driver-x86, linux-gpio, linux-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

As of commit 92ac7de3175e3 ("gpiolib: don't allow setting values on input
lines"), the GPIO core makes sure values cannot be set on input lines.
Remove the unnecessary check.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Changes in v2:
- remove the now unused variable

 drivers/platform/x86/silicom-platform.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/platform/x86/silicom-platform.c b/drivers/platform/x86/silicom-platform.c
index 021f3fed197a6..63b5da410ed57 100644
--- a/drivers/platform/x86/silicom-platform.c
+++ b/drivers/platform/x86/silicom-platform.c
@@ -248,13 +248,9 @@ static int silicom_gpio_direction_input(struct gpio_chip *gc,
 static int silicom_gpio_set(struct gpio_chip *gc, unsigned int offset,
 			    int value)
 {
-	int direction = silicom_gpio_get_direction(gc, offset);
 	u8 *channels = gpiochip_get_data(gc);
 	int channel = channels[offset];
 
-	if (direction == GPIO_LINE_DIRECTION_IN)
-		return -EPERM;
-
 	silicom_mec_port_set(channel, !value);
 
 	return 0;
-- 
2.48.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] platform/x86: silicom: remove unnecessary GPIO line direction check
  2025-06-12  7:48 [PATCH v2] platform/x86: silicom: remove unnecessary GPIO line direction check Bartosz Golaszewski
@ 2025-06-13 10:14 ` Ilpo Järvinen
  0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-06-13 10:14 UTC (permalink / raw)
  To: Hans de Goede, Linus Walleij, Bartosz Golaszewski
  Cc: platform-driver-x86, linux-gpio, linux-kernel, Bartosz Golaszewski

On Thu, 12 Jun 2025 09:48:35 +0200, Bartosz Golaszewski wrote:

> As of commit 92ac7de3175e3 ("gpiolib: don't allow setting values on input
> lines"), the GPIO core makes sure values cannot be set on input lines.
> Remove the unnecessary check.
> 
> 


Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: silicom: remove unnecessary GPIO line direction check
      commit: 5a7c909a53875e9c0c64cdf8e52b5716d8a74523

--
 i.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-13 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-12  7:48 [PATCH v2] platform/x86: silicom: remove unnecessary GPIO line direction check Bartosz Golaszewski
2025-06-13 10:14 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®