Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2016 15:45:36 +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: r300750 - in head/sys/dev: extres/regulator gpio
Message-ID:  <201605261545.u4QFjaMH003360@repo.freebsd.org>

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



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