Skip to contentSkip to conversation

gpio: gpiolib: fix conflicting flag values

PATCH In review Alexandre Courbot 2 participants 3 messages Jun 22, 2012 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: gpiolib: fix conflicting flag values

Commits aca5ce14 and 25553ff0 introduced two new GPIOF_OPEN_DRAIN and GPIOF_OPEN_SOURCE flags to gpiolib. Unfortunately they happen to be the same as GPIOF_EXPORT and GPIOF_EXPORT_CHANGEABLE, which causes all gpios exported at request time to end up open drain and/or open source.

Resolve the conflict by affecting free flags to GPIOF_EXPORT and GPIOF_EXPORT_CHANGEABLE.

---
 include/linux/gpio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/gpio.h +2 -2
index f07fc2d..2e31e8b 100644
@@ -22,8 +22,8 @@
 /* Gpio pin is open source */
 #define GPIOF_OPEN_SOURCE	(1 << 3)
 
-#define GPIOF_EXPORT		(1 << 2)
-#define GPIOF_EXPORT_CHANGEABLE	(1 << 3)
+#define GPIOF_EXPORT		(1 << 4)
+#define GPIOF_EXPORT_CHANGEABLE	(1 << 5)
 #define GPIOF_EXPORT_DIR_FIXED	(GPIOF_EXPORT)
 #define GPIOF_EXPORT_DIR_CHANGEABLE (GPIOF_EXPORT | GPIOF_EXPORT_CHANGEABLE)
 
Signature · 1 line
1.7.11
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alexandre Courbot

Commits aca5ce14 and 25553ff0 introduced two new GPIOF_OPEN_DRAIN and GPIOF_OPEN_SOURCE flags to gpiolib. Unfortunately they happen to be the same as GPIOF_EXPORT and GPIOF_EXPORT_CHANGEABLE, which causes all gpios exported at request time to end up open drain and/or open source.

Resolve the conflict by affecting free flags to GPIOF_EXPORT and GPIOF_EXPORT_CHANGEABLE.

Yes, I have sent similar patch in past.
[PATCH RESEND] gpio: fix bits conflict for gpio flags

Linus W has also Acked it and CCed to stable.

#2 lore raw
Quoted 4 lines

Yes, I have sent similar patch in past.
[PATCH RESEND] gpio: fix bits conflict for gpio flags

Linus W has also Acked it and CCed to stable.

Ah, got your last version from two days ago. Hope this is going to be merged this time, it seems like you have been pushing this fix for 2 months now.

Alex.