ath10k: fix error return code in ahb
authorWei Yongjun <weiyongjun1@huawei.com>
Fri, 16 Sep 2016 13:05:35 +0000 (13:05 +0000)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 28 Sep 2016 09:41:04 +0000 (12:41 +0300)
Fix to return a negative error code from the error handling case
instead of 0, as done elsewhere in function ath10k_ahb_probe() or
ath10k_ahb_resource_init().

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/ahb.c

index fe38b459544d648bc2f74cbe197d6425d8b92413..766c63bf05c4a969b774269d2ba4fbe80f629418 100644 (file)
@@ -509,6 +509,7 @@ static int ath10k_ahb_resource_init(struct ath10k *ar)
        ar_ahb->irq = platform_get_irq_byname(pdev, "legacy");
        if (ar_ahb->irq < 0) {
                ath10k_err(ar, "failed to get irq number: %d\n", ar_ahb->irq);
+               ret = ar_ahb->irq;
                goto err_clock_deinit;
        }
 
@@ -787,6 +788,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev)
        chip_id = ath10k_ahb_soc_read32(ar, SOC_CHIP_ID_ADDRESS);
        if (chip_id == 0xffffffff) {
                ath10k_err(ar, "failed to get chip id\n");
+               ret = -ENODEV;
                goto err_halt_device;
        }