aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-sodaville.c
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-12-16 00:52:04 -0500
committerLinus Walleij <linus.walleij@linaro.org>2013-12-20 04:23:18 -0500
commite6ae9195909a51fb8c3a7e95c2568aefe9bc912f (patch)
tree60c09f6376310b772a5a0dd9b193cbf91621558e /drivers/gpio/gpio-sodaville.c
parentca0ae81d13d9ddb8b94fadc11d5c76b5499ac1b9 (diff)
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>
Diffstat (limited to 'drivers/gpio/gpio-sodaville.c')
-rw-r--r--drivers/gpio/gpio-sodaville.c8
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,
176 176
177 sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS, 177 sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
178 sd->irq_base, 0, &irq_domain_sdv_ops, sd); 178 sd->irq_base, 0, &irq_domain_sdv_ops, sd);
179 if (!sd->id) 179 if (!sd->id) {
180 ret = -ENODEV;
180 goto out_free_irq; 181 goto out_free_irq;
182 }
181 return 0; 183 return 0;
182out_free_irq: 184out_free_irq:
183 free_irq(pdev->irq, sd); 185 free_irq(pdev->irq, sd);
@@ -212,8 +214,10 @@ static int sdv_gpio_probe(struct pci_dev *pdev,
212 } 214 }
213 215
214 addr = pci_resource_start(pdev, GPIO_BAR); 216 addr = pci_resource_start(pdev, GPIO_BAR);
215 if (!addr) 217 if (!addr) {
218 ret = -ENODEV;
216 goto release_reg; 219 goto release_reg;
220 }
217 sd->gpio_pub_base = ioremap(addr, pci_resource_len(pdev, GPIO_BAR)); 221 sd->gpio_pub_base = ioremap(addr, pci_resource_len(pdev, GPIO_BAR));
218 222
219 prop = of_get_property(pdev->dev.of_node, "intel,muxctl", &len); 223 prop = of_get_property(pdev->dev.of_node, "intel,muxctl", &len);