Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp182570rwb; Wed, 9 Nov 2022 22:28:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM6v73X9kxi9GRqkEn5Elq0PXJo5ACv/zU7ygg7hogcBEHzKK39XUPAZYdErWWXQgPRoSo20 X-Received: by 2002:a05:6402:1955:b0:462:f2e2:53aa with SMTP id f21-20020a056402195500b00462f2e253aamr1714439edz.384.1668061687574; Wed, 09 Nov 2022 22:28:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668061687; cv=none; d=google.com; s=arc-20160816; b=pj/gDVVDdzC+O9C/kXUTp01BIjxv49xGMVhaRwCNPxmUr3o+E0UVbHiYtGyVmG7mFp 2+A4m14Jj6Z2W8S+E2mGlwcOab2c0x/Fx9Utr2S/vRVYIrOFlAxm3enhY6xFsEFeM/3E Nc4U4IwvGfwWX+/fbRQJhAPPGukHS4Yu8V3UMLO0XFCeVVS6I2XyRf/fdvjs5LHqlfqb DSd1/E1cVnaLMvCDU/JlWOvkmERKPRG1Wq/xWf2CAvpsuU+HxZp4VV8QOT5gEqAt3AtC 2KoCF+V33faiAUfGfSWJByf7JiFcOjpQ+O3vBXh3RDO/wDuo4rDrlvyifdgB+iy3A/Hq y8qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=5Z1z9bvM4moMoQc3G+RKTf2L53Z23El+NSE0z7aVB6o=; b=Qdn3Cev8f6cvOdg1ZdRdn2XqwVHi+3OtoRsfvZQheSDqeIT0QoYRezUZBp7Rl7/eCs s6Dv+7+3nfdBhEmVbrCfZFfHyeVEiVKKREikegU0BAH5prDSdB2m4a65SyoPOy0wSA+m job8qlPw+97VsRtQLT0d/CGUxFJ3OGu9Q8cntbSnYEIfxTZE7vQi5N4n61jRNQGRql+G VSJiinPi/uQFYBe6lbBWjU5+Vcxc+bUfCVNQgpxcFP2JnPHhctjjRsUk95VG7c5yaNc7 WY+Dq/xwfzQgVdU0UJ19fNErpdPufUJmbhGZ00LhSBR1OEJVTD69lEahDim3HFcuqc1/ Z4Aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g3-20020a1709065d0300b007820f00167fsi21217918ejt.260.2022.11.09.22.27.45; Wed, 09 Nov 2022 22:28:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbiKJGWm (ORCPT + 66 others); Thu, 10 Nov 2022 01:22:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbiKJGWl (ORCPT ); Thu, 10 Nov 2022 01:22:41 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FF522E9CB; Wed, 9 Nov 2022 22:22:39 -0800 (PST) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4N7BWW315VzJnYn; Thu, 10 Nov 2022 14:19:35 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 14:22:37 +0800 From: Xiu Jianfeng To: , , , , , CC: , , , Subject: [PATCH RESEND v2] wifi: ath10k: Fix return value in ath10k_pci_init() Date: Thu, 10 Nov 2022 14:19:26 +0800 Message-ID: <20221110061926.18163-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This driver is attempting to register to support two different buses. if either of these is successful then ath10k_pci_init() should return 0 so that hardware attached to the successful bus can be probed and supported. only if both of these are unsuccessful should ath10k_pci_init() return an errno. Fixes: 0b523ced9a3c ("ath10k: add basic skeleton to support ahb") Signed-off-by: Xiu Jianfeng --- v2: modify according to Jeff's suggestion, and change the commit message and body as well. --- drivers/net/wireless/ath/ath10k/pci.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index e56c6a6b1379..728d607289c3 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3792,18 +3792,22 @@ static struct pci_driver ath10k_pci_driver = { static int __init ath10k_pci_init(void) { - int ret; + int ret1, ret2; - ret = pci_register_driver(&ath10k_pci_driver); - if (ret) + ret1 = pci_register_driver(&ath10k_pci_driver); + if (ret1) printk(KERN_ERR "failed to register ath10k pci driver: %d\n", - ret); + ret1); - ret = ath10k_ahb_init(); - if (ret) - printk(KERN_ERR "ahb init failed: %d\n", ret); + ret2 = ath10k_ahb_init(); + if (ret2) + printk(KERN_ERR "ahb init failed: %d\n", ret2); - return ret; + if (ret1 && ret2) + return ret1; + + /* registered to at least one bus */ + return 0; } module_init(ath10k_pci_init); -- 2.17.1