diff options
author | Stephen Warren <swarren@nvidia.com> | 2013-12-06 21:36:11 +0100 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-11 13:37:48 +0100 |
commit | f57f98a6c0f4f3cb4d2ec9f9566b8e3f21843f03 (patch) | |
tree | 35b36d8fcdcf6a685def44d251f67bc3631a56cb /drivers/gpio/gpio-tegra.c | |
parent | ARM: tegra: add gpiod_lookup table for paz00 (diff) | |
download | linux-f57f98a6c0f4f3cb4d2ec9f9566b8e3f21843f03.tar.xz linux-f57f98a6c0f4f3cb4d2ec9f9566b8e3f21843f03.zip |
gpio: tegra: add missing error handling to probe
The call to gpiochip_add() is not currently error-checked. Add the
missing checking.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-tegra.c')
-rw-r--r-- | drivers/gpio/gpio-tegra.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index cfd3b9037bc7..2b49f878b56c 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c @@ -425,6 +425,7 @@ static int tegra_gpio_probe(struct platform_device *pdev) struct tegra_gpio_soc_config *config; struct resource *res; struct tegra_gpio_bank *bank; + int ret; int gpio; int i; int j; @@ -494,7 +495,11 @@ static int tegra_gpio_probe(struct platform_device *pdev) tegra_gpio_chip.of_node = pdev->dev.of_node; - gpiochip_add(&tegra_gpio_chip); + ret = gpiochip_add(&tegra_gpio_chip); + if (ret < 0) { + irq_domain_remove(irq_domain); + return ret; + } for (gpio = 0; gpio < tegra_gpio_chip.ngpio; gpio++) { int irq = irq_create_mapping(irq_domain, gpio); |