diff options
author | loos <loos@FreeBSD.org> | 2015-03-05 03:11:47 +0000 |
---|---|---|
committer | loos <loos@FreeBSD.org> | 2015-03-05 03:11:47 +0000 |
commit | 80210b69e0654f1a39d17d24489e2721b9253c5b (patch) | |
tree | b22dbe2d9b1bfd6cb7d2abcc75c429e4642dd081 | |
parent | 4655e1ef1928f6b30c6c5cdddd37c93568152498 (diff) | |
download | FreeBSD-src-80210b69e0654f1a39d17d24489e2721b9253c5b.zip FreeBSD-src-80210b69e0654f1a39d17d24489e2721b9253c5b.tar.gz |
Use the child device name here is lame because at the point that this
happens, the child device is not yet specified.
-rw-r--r-- | sys/dev/gpio/gpiobus.c | 9 | ||||
-rw-r--r-- | sys/dev/gpio/gpiobusvar.h | 2 | ||||
-rw-r--r-- | sys/dev/gpio/ofw_gpiobus.c | 3 |
3 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 89740d1..11a33d7 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -230,21 +230,20 @@ gpiobus_free_ivars(struct gpiobus_ivar *devi) } int -gpiobus_map_pin(device_t bus, device_t child, uint32_t pin) +gpiobus_map_pin(device_t bus, uint32_t pin) { struct gpiobus_softc *sc; sc = device_get_softc(bus); /* Consistency check. */ if (pin >= sc->sc_npins) { - device_printf(child, + device_printf(bus, "invalid pin %d, max: %d\n", pin, sc->sc_npins - 1); return (-1); } /* Mark pin as mapped and give warning if it's already mapped. */ if (sc->sc_pins_mapped[pin]) { - device_printf(child, - "warning: pin %d is already mapped\n", pin); + device_printf(bus, "warning: pin %d is already mapped\n", pin); return (-1); } sc->sc_pins_mapped[pin] = 1; @@ -277,7 +276,7 @@ gpiobus_parse_pins(struct gpiobus_softc *sc, device_t child, int mask) if ((mask & (1 << i)) == 0) continue; /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(sc->sc_busdev, child, i) != 0) { + if (gpiobus_map_pin(sc->sc_busdev, i) != 0) { gpiobus_free_ivars(devi); return (EINVAL); } diff --git a/sys/dev/gpio/gpiobusvar.h b/sys/dev/gpio/gpiobusvar.h index beffb7f..315709a 100644 --- a/sys/dev/gpio/gpiobusvar.h +++ b/sys/dev/gpio/gpiobusvar.h @@ -110,7 +110,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, device_t, uint32_t); +int gpiobus_map_pin(device_t, uint32_t); extern driver_t gpiobus_driver; diff --git a/sys/dev/gpio/ofw_gpiobus.c b/sys/dev/gpio/ofw_gpiobus.c index 3eb6b86..da72d4d 100644 --- a/sys/dev/gpio/ofw_gpiobus.c +++ b/sys/dev/gpio/ofw_gpiobus.c @@ -282,8 +282,7 @@ ofw_gpiobus_parse_gpios_impl(device_t consumer, phandle_t cnode, char *pname, goto fail; } /* Reserve the GPIO pin. */ - if (gpiobus_map_pin(bussc->sc_busdev, consumer, - (*pins)[j].pin) != 0) + if (gpiobus_map_pin(bussc->sc_busdev, (*pins)[j].pin) != 0) goto fail; j++; i += gpiocells + 1; |