Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] gpio: cdev: remove redundant direction check in linehandle set values
@ 2026-10-20  8:06 Kent Gibson
  0 siblings, 0 replies; only message in thread
From: Kent Gibson @ 2026-10-20  8:06 UTC (permalink / raw)
  To: brgl, linusw; +Cc: linux-gpio, linux-kernel, Kent Gibson

Since commit 92ac7de3175e ("gpiolib: don't allow setting values on input
lines"), direction checking is performed by gpiolib core code.
As part of that patch, the now redundant check was removed from uAPI v2
linereq_set_values(), but the corresponding check in uAPI v1 linehandle
set values was left. Remove it.

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 drivers/gpio/gpiolib-cdev.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 6dc01f7ea838..bc1b45f50892 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -234,13 +234,6 @@ static long linehandle_ioctl(struct file *file, unsigned int cmd,
 
 		return 0;
 	case GPIOHANDLE_SET_LINE_VALUES_IOCTL:
-		/*
-		 * All line descriptors were created at once with the same
-		 * flags so just check if the first one is really output.
-		 */
-		if (!test_bit(GPIOD_FLAG_IS_OUT, &lh->descs[0]->flags))
-			return -EPERM;
-
 		if (copy_from_user(&ghd, ip, sizeof(ghd)))
 			return -EFAULT;
 

base-commit: 47f16cf7a6017212230985f6bc7f1b55b6d234d9
-- 
2.56.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-20  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20  8:06 [PATCH] gpio: cdev: remove redundant direction check in linehandle set values Kent Gibson

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