Author: ian
Date: Wed Mar  1 18:05:40 2017
New Revision: 314499
URL: https://svnweb.freebsd.org/changeset/base/314499

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

Modified:
  stable/11/sys/dev/gpio/ofw_gpiobus.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/gpio/ofw_gpiobus.c
==============================================================================
--- stable/11/sys/dev/gpio/ofw_gpiobus.c        Wed Mar  1 18:03:34 2017        
(r314498)
+++ stable/11/sys/dev/gpio/ofw_gpiobus.c        Wed Mar  1 18:05:40 2017        
(r314499)
@@ -176,9 +176,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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to