Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jan 2017 22:55:23 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r311658 - head/sys/dev/gpio
Message-ID:  <201701072255.v07MtNPb039636@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701072255.v07MtNPb039636>