Skip to contentSkip to conversation

gpio: cdev: remove redundant direction check in linehandle set values

PATCH Applied Kent Gibson 2 participants 2 messages Oct 20

Subsystems (2)
lore
Share & tools
lore

Kent Gibson

author reviewer
#0 lore raw

PATCH 1/1 gpio: cdev: remove redundant direction check in linehandle set values

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.

---
 drivers/gpio/gpiolib-cdev.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/gpio/gpiolib-cdev.c +0 -7
index 6dc01f7ea838..bc1b45f50892 100644
@@ -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

Signature · 1 line
2.56.0
#1 lore raw
Quoted 8 lines · 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.

[...]

Applied, thanks!

[1/1] gpio: cdev: remove redundant direction check in linehandle set values

      https://git.kernel.org/brgl/c/c890f6755369247ecf3c27199ca3c3f4b007fc1d

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>