]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/gpio/gpio-generic.c
Merge tag 'devicetree-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / gpio / gpio-generic.c
index b5dff9e742f846e65660ea046ebb6f402cca4763..fea8c82bb8fcc2a96bfb4135dbeed0845b46d517 100644 (file)
@@ -388,6 +388,14 @@ static int bgpio_setup_direction(struct bgpio_chip *bgc,
        return 0;
 }
 
+static int bgpio_request(struct gpio_chip *chip, unsigned gpio_pin)
+{
+       if (gpio_pin < chip->ngpio)
+               return 0;
+
+       return -EINVAL;
+}
+
 int bgpio_remove(struct bgpio_chip *bgc)
 {
        return gpiochip_remove(&bgc->gc);
@@ -413,6 +421,7 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
        bgc->gc.label = dev_name(dev);
        bgc->gc.base = -1;
        bgc->gc.ngpio = bgc->bits;
+       bgc->gc.request = bgpio_request;
 
        ret = bgpio_setup_io(bgc, dat, set, clr);
        if (ret)