Skip to contentSkip to conversation

staging: greybus: remove unnecessary GPIO line direction check

PATCH In review Bartosz Golaszewski 2 participants 2 messages Jun 10, 2025 – Jun 11, 2025

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

PATCH 1/1 staging: greybus: 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.

---
 drivers/staging/greybus/gpio.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/greybus/gpio.c +0 -6
index f81c34160f720..1280530c8987a 100644
@@ -192,12 +192,6 @@ static int gb_gpio_set_value_operation(struct gb_gpio_controller *ggc,
 	struct gb_gpio_set_value_request request;
 	int ret;
 
-	if (ggc->lines[which].direction == 1) {
-		dev_warn(dev, "refusing to set value of input gpio %u\n",
-			 which);
-		return -EPERM;
-	}
-
 	request.which = which;
 	request.value = value_high ? 1 : 0;
 	ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_SET_VALUE,
Signature · 1 line
2.48.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Hey Bartosz,
Thanks for the patch.

Quoted 7 lines · Bartosz Golaszewski

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.

LGTM.

Cheers,
Rui

Quoted 23 lines
---
 drivers/staging/greybus/gpio.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/greybus/gpio.c +0 -6
index f81c34160f720..1280530c8987a 100644
@@ -192,12 +192,6 @@ static int gb_gpio_set_value_operation(struct gb_gpio_controller *ggc,
 	struct gb_gpio_set_value_request request;
 	int ret;
 
-	if (ggc->lines[which].direction == 1) {
-		dev_warn(dev, "refusing to set value of input gpio %u\n",
-			 which);
-		return -EPERM;
-	}
-
 	request.which = which;
 	request.value = value_high ? 1 : 0;
 	ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_SET_VALUE,
Signature · 1 line
2.48.1