Author: ian
Date: Sat Jan  7 22:55:23 2017
New Revision: 311658
URL: https://svnweb.freebsd.org/changeset/base/311658

Log:
  Only write to *active once, even when GPIO_ACTIVE_LOW is set.

Modified:
  head/sys/dev/gpio/ofw_gpiobus.c

Modified: head/sys/dev/gpio/ofw_gpiobus.c
==============================================================================
--- head/sys/dev/gpio/ofw_gpiobus.c     Sat Jan  7 20:26:19 2017        
(r311657)
+++ head/sys/dev/gpio/ofw_gpiobus.c     Sat Jan  7 22:55:23 2017        
(r311658)
@@ -178,9 +178,10 @@ gpio_pin_is_active(gpio_pin_t pin, bool 
                return (rv);
        }
 
-       *active = tmp != 0;
        if (pin->flags & GPIO_ACTIVE_LOW)
-               *active = !(*active);
+               *active = tmp == 0;
+       else
+               *active = tmp != 0;
        return (0);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to