From owner-svn-src-stable@freebsd.org Wed Jan 4 00:25:23 2017 Return-Path: Delivered-To: svn-src-stable@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 589E3C9EFE6; Wed, 4 Jan 2017 00:25:23 +0000 (UTC) (envelope-from loos@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 27A961E7D; Wed, 4 Jan 2017 00:25:23 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v040PMp8079940; Wed, 4 Jan 2017 00:25:22 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v040PMmv079939; Wed, 4 Jan 2017 00:25:22 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201701040025.v040PMmv079939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Wed, 4 Jan 2017 00:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311205 - stable/11/sys/dev/rccgpio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 00:25:23 -0000 Author: loos Date: Wed Jan 4 00:25:22 2017 New Revision: 311205 URL: https://svnweb.freebsd.org/changeset/base/311205 Log: MFC of r310887: Fix rcc_gpio_modify_bits(). Obviously (1 << 0) is not the same as 0. Pointy hat to: loos Modified: stable/11/sys/dev/rccgpio/rccgpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/rccgpio/rccgpio.c ============================================================================== --- stable/11/sys/dev/rccgpio/rccgpio.c Wed Jan 4 00:18:51 2017 (r311204) +++ stable/11/sys/dev/rccgpio/rccgpio.c Wed Jan 4 00:25:22 2017 (r311205) @@ -57,12 +57,12 @@ struct rcc_gpio_pin { }; static struct rcc_gpio_pin rcc_pins[] = { - { .pin = 11, .name = "reset switch", .caps = GPIO_PIN_INPUT }, - { .pin = 15, .name = "red LED", .caps = GPIO_PIN_OUTPUT }, - { .pin = 17, .name = "green LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 11), .name = "reset switch", .caps = GPIO_PIN_INPUT }, + { .pin = (1 << 15), .name = "red LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 17), .name = "green LED", .caps = GPIO_PIN_OUTPUT }, #if 0 - { .pin = 16, .name = "HD1 LED", .caps = GPIO_PIN_OUTPUT }, - { .pin = 18, .name = "HD2 LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 16), .name = "HD1 LED", .caps = GPIO_PIN_OUTPUT }, + { .pin = (1 << 18), .name = "HD2 LED", .caps = GPIO_PIN_OUTPUT }, #endif }; @@ -87,14 +87,14 @@ struct rcc_gpio_softc { static void rcc_gpio_modify_bits(struct rcc_gpio_softc *sc, uint32_t reg, uint32_t mask, - uint32_t bit) + uint32_t writebits) { uint32_t value; RCC_GPIO_LOCK(sc); value = RCC_READ(sc, reg); - value &= ~(1 << mask); - value |= (1 << bit); + value &= ~mask; + value |= writebits; RCC_WRITE(sc, reg, value); RCC_GPIO_UNLOCK(sc); }