From owner-svn-src-head@freebsd.org Sat Jan 7 22:55:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43CB3CA4048; Sat, 7 Jan 2017 22:55:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 128311E3D; Sat, 7 Jan 2017 22:55:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v07MtNUB039637; Sat, 7 Jan 2017 22:55:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v07MtNPb039636; Sat, 7 Jan 2017 22:55:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201701072255.v07MtNPb039636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 7 Jan 2017 22:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311658 - head/sys/dev/gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Jan 2017 22:55:24 -0000 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); }