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

mmc: sdhci-acpi: fix error return code in sdhci_acpi_add_own_cd()

Fix to return a negative error code in the gpio_to_irq() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by

Wei Yongjun and committed by
Chris Ball
5a0e8074 3f7eec62

+3 -1
+3 -1
drivers/mmc/host/sdhci-acpi.c
··· 189 189 goto out; 190 190 191 191 irq = gpio_to_irq(gpio); 192 - if (irq < 0) 192 + if (irq < 0) { 193 + err = irq; 193 194 goto out_free; 195 + } 194 196 195 197 flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING; 196 198 err = devm_request_irq(dev, irq, sdhci_acpi_sd_cd, flags, "sd_cd", mmc);