diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-12-16 13:52:04 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-12-20 10:23:18 +0100 |
commit | e6ae9195909a51fb8c3a7e95c2568aefe9bc912f (patch) | |
tree | 60c09f6376310b772a5a0dd9b193cbf91621558e | |
parent | ca0ae81d13d9ddb8b94fadc11d5c76b5499ac1b9 (diff) | |
download | blackbird-op-linux-e6ae9195909a51fb8c3a7e95c2568aefe9bc912f.tar.gz blackbird-op-linux-e6ae9195909a51fb8c3a7e95c2568aefe9bc912f.zip |
gpio: sodaville: fix some error return code on error path
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>
-rw-r--r-- | drivers/gpio/gpio-sodaville.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-sodaville.c b/drivers/gpio/gpio-sodaville.c index 5d171e0182db..7c6c518929bc 100644 --- a/drivers/gpio/gpio-sodaville.c +++ b/drivers/gpio/gpio-sodaville.c @@ -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); @@ -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); |