From owner-svn-src-all@freebsd.org Thu May 26 15:45:38 2016 Return-Path: Delivered-To: svn-src-all@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 3B371B4B885; Thu, 26 May 2016 15:45:38 +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 12A3A1CC4; Thu, 26 May 2016 15:45:37 +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 u4QFjbuE003364; Thu, 26 May 2016 15:45:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4QFjaMH003360; Thu, 26 May 2016 15:45:36 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201605261545.u4QFjaMH003360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 26 May 2016 15:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300750 - in head/sys/dev: extres/regulator gpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 May 2016 15:45:38 -0000 Author: ian Date: Thu May 26 15:45:36 2016 New Revision: 300750 URL: https://svnweb.freebsd.org/changeset/base/300750 Log: Rename gpiobus_map_pin() to gpiobus_acquire_pin(), to better reflect the fact that the caller is requesting exclusive use of the pin, and also to better match the inverse operation which is named gpiobus_release_pin(). Modified: head/sys/dev/extres/regulator/regulator_fixed.c head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/extres/regulator/regulator_fixed.c ============================================================================== --- head/sys/dev/extres/regulator/regulator_fixed.c Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/extres/regulator/regulator_fixed.c Thu May 26 15:45:36 2016 (r300750) @@ -115,8 +115,8 @@ regnode_get_gpio_entry(struct gpiobus_pi } /* Reserve pin. */ - /* XXX Can we call gpiobus_map_pin() with gpio_list_mtx mutex held? */ - rv = gpiobus_map_pin(busdev, gpio_pin->pin); + /* XXX Can we call gpiobus_acquire_pin() with gpio_list_mtx held? */ + rv = gpiobus_acquire_pin(busdev, gpio_pin->pin); if (rv != 0) { mtx_unlock(&gpio_list_mtx); free(entry, M_FIXEDREGULATOR); Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/gpio/gpiobus.c Thu May 26 15:45:36 2016 (r300750) @@ -260,7 +260,7 @@ gpiobus_free_ivars(struct gpiobus_ivar * } int -gpiobus_map_pin(device_t bus, uint32_t pin) +gpiobus_acquire_pin(device_t bus, uint32_t pin) { struct gpiobus_softc *sc; @@ -291,13 +291,13 @@ gpiobus_release_pin(device_t bus, uint32 /* Consistency check. */ if (pin >= sc->sc_npins) { device_printf(bus, - "gpiobus_map_pin: invalid pin %d, max=%d\n", + "gpiobus_acquire_pin: invalid pin %d, max=%d\n", pin, sc->sc_npins - 1); return (-1); } if (!sc->sc_pins[pin].mapped) { - device_printf(bus, "gpiobus_map_pin: pin %d is not mapped\n", pin); + device_printf(bus, "gpiobus_acquire_pin: pin %d is not mapped\n", pin); return (-1); } sc->sc_pins[pin].mapped = 0; @@ -330,7 +330,7 @@ gpiobus_parse_pins(struct gpiobus_softc if ((mask & (1 << i)) == 0) continue; /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(sc->sc_busdev, i) != 0) { + if (gpiobus_acquire_pin(sc->sc_busdev, i) != 0) { gpiobus_free_ivars(devi); return (EINVAL); } Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/gpio/gpiobusvar.h Thu May 26 15:45:36 2016 (r300750) @@ -137,7 +137,7 @@ int gpiobus_detach_bus(device_t); int gpiobus_init_softc(device_t); int gpiobus_alloc_ivars(struct gpiobus_ivar *); void gpiobus_free_ivars(struct gpiobus_ivar *); -int gpiobus_map_pin(device_t, uint32_t); +int gpiobus_acquire_pin(device_t, uint32_t); int gpiobus_release_pin(device_t, uint32_t); extern driver_t gpiobus_driver; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 15:12:54 2016 (r300749) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 26 15:45:36 2016 (r300750) @@ -95,7 +95,7 @@ gpio_pin_get_by_ofw_impl(device_t consum return (ENXIO); /* Reserve GPIO pin. */ - rv = gpiobus_map_pin(busdev, pin.pin); + rv = gpiobus_acquire_pin(busdev, pin.pin); if (rv != 0) return (EBUSY); @@ -457,7 +457,7 @@ ofw_gpiobus_parse_gpios_impl(device_t co goto fail; } /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(bussc->sc_busdev, (*pins)[j].pin) != 0) + if (gpiobus_acquire_pin(bussc->sc_busdev, (*pins)[j].pin) != 0) goto fail; j++; i += gpiocells + 1;