
On Fri, Oct 23, 2015 at 03:59:18PM -0700, Stefan Agner wrote:
Currently we return the GPIO value directly as command exit code. In shell exit codes, 0 means success. Hence if a GPIO is one, we actually return a "failure". Fix this by returning SUCCESS if the value is positive.
This allows to implement scripts more naturally e.g.: if gpio input 47; then echo "Pressed"; else echo "Not pressed"; fi
Signed-off-by: Stefan Agner stefan@agner.ch
Not sure if it is the right thing to do to change that, maybe there are a lot of users which rely on that output already?
It just feels a bit more natural to me when using the command in scripts...
My first reaction is, wait, we don't work like that today? I need to try the omap3_beagle gpio stuff out on my board again since there are users today that at first blush read like what you're saying doesn't work today, so I wonder if things broke by accident at some point in the (hopefully not too distant) past.