diff options
Diffstat (limited to 'drivers/gpio/gpio-generic.c')
-rw-r--r-- | drivers/gpio/gpio-generic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-generic.c b/drivers/gpio/gpio-generic.c index b5dff9e742f8..fea8c82bb8fc 100644 --- a/drivers/gpio/gpio-generic.c +++ b/drivers/gpio/gpio-generic.c | |||
@@ -388,6 +388,14 @@ static int bgpio_setup_direction(struct bgpio_chip *bgc, | |||
388 | return 0; | 388 | return 0; |
389 | } | 389 | } |
390 | 390 | ||
391 | static int bgpio_request(struct gpio_chip *chip, unsigned gpio_pin) | ||
392 | { | ||
393 | if (gpio_pin < chip->ngpio) | ||
394 | return 0; | ||
395 | |||
396 | return -EINVAL; | ||
397 | } | ||
398 | |||
391 | int bgpio_remove(struct bgpio_chip *bgc) | 399 | int bgpio_remove(struct bgpio_chip *bgc) |
392 | { | 400 | { |
393 | return gpiochip_remove(&bgc->gc); | 401 | return gpiochip_remove(&bgc->gc); |
@@ -413,6 +421,7 @@ int bgpio_init(struct bgpio_chip *bgc, struct device *dev, | |||
413 | bgc->gc.label = dev_name(dev); | 421 | bgc->gc.label = dev_name(dev); |
414 | bgc->gc.base = -1; | 422 | bgc->gc.base = -1; |
415 | bgc->gc.ngpio = bgc->bits; | 423 | bgc->gc.ngpio = bgc->bits; |
424 | bgc->gc.request = bgpio_request; | ||
416 | 425 | ||
417 | ret = bgpio_setup_io(bgc, dat, set, clr); | 426 | ret = bgpio_setup_io(bgc, dat, set, clr); |
418 | if (ret) | 427 | if (ret) |