Properly release mapped pin in gpio_pin_release
This commit is contained in:
parent
3381a3898a
commit
f058b6fbee
@ -139,10 +139,17 @@ gpio_pin_get_by_ofw_name(device_t consumer, phandle_t node,
|
||||
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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user