Skip to contentSkip to conversation

platform/x86: silicom: remove unnecessary GPIO line direction check

PATCH In review Bartosz Golaszewski 2 participants 2 messages Jun 12, 2025 – Jun 13, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 platform/x86: silicom: remove unnecessary GPIO line direction check

From: Bartosz Golaszewski <[email protected]>

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.

---
Changes in v2:
- remove the now unused variable

 drivers/platform/x86/silicom-platform.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/platform/x86/silicom-platform.c +0 -4
index 021f3fed197a6..63b5da410ed57 100644
@@ -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;
Signature · 1 line
2.48.1
maintainer
#1 lore raw
Quoted 5 lines · Bartosz Golaszewski

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.