From owner-svn-src-all@FreeBSD.ORG Thu Mar 5 03:11:49 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2037B5; Thu, 5 Mar 2015 03:11:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 C33C9E9A; Thu, 5 Mar 2015 03:11:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t253Bmve061775; Thu, 5 Mar 2015 03:11:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t253BmSG061772; Thu, 5 Mar 2015 03:11:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201503050311.t253BmSG061772@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 5 Mar 2015 03:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279622 - 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 05 Mar 2015 03:11:49 -0000 Author: loos Date: Thu Mar 5 03:11:47 2015 New Revision: 279622 URL: https://svnweb.freebsd.org/changeset/base/279622 Log: Use the child device name here is lame because at the point that this happens, the child device is not yet specified. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Mar 5 02:54:30 2015 (r279621) +++ head/sys/dev/gpio/gpiobus.c Thu Mar 5 03:11:47 2015 (r279622) @@ -230,21 +230,20 @@ gpiobus_free_ivars(struct gpiobus_ivar * } 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 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); } Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu Mar 5 02:54:30 2015 (r279621) +++ head/sys/dev/gpio/gpiobusvar.h Thu Mar 5 03:11:47 2015 (r279622) @@ -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; Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu Mar 5 02:54:30 2015 (r279621) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu Mar 5 03:11:47 2015 (r279622) @@ -282,8 +282,7 @@ ofw_gpiobus_parse_gpios_impl(device_t co 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;