Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wei Yongjun and committed by
Linus Walleij
e6ae9195 ca0ae81d

+6 -2
+6 -2
drivers/gpio/gpio-sodaville.c
··· 176 176 177 177 sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS, 178 178 sd->irq_base, 0, &irq_domain_sdv_ops, sd); 179 - if (!sd->id) 179 + if (!sd->id) { 180 + ret = -ENODEV; 180 181 goto out_free_irq; 182 + } 181 183 return 0; 182 184 out_free_irq: 183 185 free_irq(pdev->irq, sd); ··· 214 212 } 215 213 216 214 addr = pci_resource_start(pdev, GPIO_BAR); 217 - if (!addr) 215 + if (!addr) { 216 + ret = -ENODEV; 218 217 goto release_reg; 218 + } 219 219 sd->gpio_pub_base = ioremap(addr, pci_resource_len(pdev, GPIO_BAR)); 220 220 221 221 prop = of_get_property(pdev->dev.of_node, "intel,muxctl", &len);