Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
gpio: sodaville: fix some error return code on error path
Browse files Browse the repository at this point in the history
Fix to return a negative error code from the error handling
case instead of 0.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Wei Yongjun authored and linusw committed Dec 20, 2013
1 parent ca0ae81 commit e6ae919
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpio/gpio-sodaville.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,

sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
sd->irq_base, 0, &irq_domain_sdv_ops, sd);
if (!sd->id)
if (!sd->id) {
ret = -ENODEV;
goto out_free_irq;
}
return 0;
out_free_irq:
free_irq(pdev->irq, sd);
Expand Down Expand Up @@ -212,8 +214,10 @@ static int sdv_gpio_probe(struct pci_dev *pdev,
}

addr = pci_resource_start(pdev, GPIO_BAR);
if (!addr)
if (!addr) {
ret = -ENODEV;
goto release_reg;
}
sd->gpio_pub_base = ioremap(addr, pci_resource_len(pdev, GPIO_BAR));

prop = of_get_property(pdev->dev.of_node, "intel,muxctl", &len);
Expand Down

0 comments on commit e6ae919

Please sign in to comment.