提交 f57f98a6 编写于 作者: S Stephen Warren 提交者: Linus Walleij

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: NStephen Warren <swarren@nvidia.com>
Reviewed-by: NThierry Reding <treding@nvidia.com>
Reviewed-by: NAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 7bb3ed21
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册