• Linus Walleij's avatar
    gpio: reference count the gpio device for each desc · 33a68e86
    Linus Walleij authored
    Every time a descriptor is retrieved from the gpiolib, we issue
    module_get() to reference count the module supplying the GPIOs.
    We also need to call device_get() and device_put() as we also
    reference the backing gpio_device when doing this.
    
    Since the sysfs GPIO interface is using gpiod_get() this will
    also reference count the sysfs requests until all GPIOs are
    unexported.
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    33a68e86
gpiolib.c 76 KB