Date: Thu, 12 May 2016 20:13:16 +0000 (UTC) From: Oleksandr Tymoshenko <gonzo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299564 - head/sys/dev/gpio Message-ID: <201605122013.u4CKDG0I040957@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gonzo Date: Thu May 12 20:13:16 2016 New Revision: 299564 URL: https://svnweb.freebsd.org/changeset/base/299564 Log: Properly release mapped pin in gpio_pin_release Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 12 20:12:45 2016 (r299563) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 12 20:13:16 2016 (r299564) @@ -139,10 +139,17 @@ gpio_pin_get_by_ofw_name(device_t consum void gpio_pin_release(gpio_pin_t gpio) { + device_t busdev; if (gpio == NULL) return; + KASSERT(gpio->dev != NULL, ("invalid pin state")); + + busdev = GPIO_GET_BUS(gpio->dev); + if (busdev != NULL) + gpiobus_release_pin(busdev, gpio->pin); + /* XXXX Unreserve pin. */ free(gpio, M_DEVBUF); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605122013.u4CKDG0I040957>