diff options
| -rw-r--r-- | drivers/gpio/gpiolib-of.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 0220dd6d64ed..6a3ec575a404 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
| @@ -718,7 +718,13 @@ int of_gpiochip_add(struct gpio_chip *chip) | |||
| 718 | 718 | ||
| 719 | of_node_get(chip->of_node); | 719 | of_node_get(chip->of_node); |
| 720 | 720 | ||
| 721 | return of_gpiochip_scan_gpios(chip); | 721 | status = of_gpiochip_scan_gpios(chip); |
| 722 | if (status) { | ||
| 723 | of_node_put(chip->of_node); | ||
| 724 | gpiochip_remove_pin_ranges(chip); | ||
| 725 | } | ||
| 726 | |||
| 727 | return status; | ||
| 722 | } | 728 | } |
| 723 | 729 | ||
| 724 | void of_gpiochip_remove(struct gpio_chip *chip) | 730 | void of_gpiochip_remove(struct gpio_chip *chip) |
