Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp34042rwb; Wed, 9 Nov 2022 19:25:58 -0800 (PST) X-Google-Smtp-Source: AMsMyM4469ZLXiorCfBr44lHvk2ADNKPKk3M/pGjpzoPGeYEYnDYJ2ZOtRPXoOGT0/dviPgiufSj X-Received: by 2002:a05:6402:3c2:b0:464:61f5:6d86 with SMTP id t2-20020a05640203c200b0046461f56d86mr30843149edw.382.1668050758635; Wed, 09 Nov 2022 19:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668050758; cv=none; d=google.com; s=arc-20160816; b=saM47U0ZY1t7vheITv/Xa5yisOUwy+vd4l+c9C2v3hsrb0KbfOhSi5Y1Bq/jlC57rm vuSX64mZK5W4N1gIvjUjz0Cl8K6cYfmd2VRbBhd9q/qAmuFpdjPIpnhJbw557h7SXNGM 8f2XHd4KnPLJH0cyB2VW74sY4z0uo8Wkz5gtHlrGINp5eyOW1DFoVqDse/wQ1o42Sth+ gywnhutQ+pAeqv2hJUqNRNFi7Ruo6qBOqct6He5vB9LzqKpQ6YRi/LezcyM8XyT70afk RTk9w5kVA81Exbc33ZqiKIrwwMZHQjK96YHgKfVz6ZerjYLRXNDbPYFSoIwlrHVmJPVF N8fw== 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=p3YV9t2mdfy1QWuSjZBj2nC+nPq6VNxBfwUmijG1Tkk6tPumoHdJqSJUQ2lFgaAm9Y Grh0fUVWTWJofN6UXCagW3mp14yuTmSSYBvQs1Z1iGGoHCkIqEmDPJ/HlpJUe+Ml0/ob 9Tlpbp8qNBBiHhdBxvADBhiunyH+hzsofwy6PGaBVe27/vKtBPCTmuafI/vovJfoLawT MhnTkyeDxjChByQ4PA10Tguns0Yf6ROIaM52ajMPJ57uKqnnsHImRzyTKWx+baQo2fpX 6tAWv9WMiUZkhyXw+CEJGsiTJVH2EvyRRYK6kCMdVPkcd+lqkdBXgeQujdTJNM4C6gXA vxQA== 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 a16-20020aa7cf10000000b00461bbc0aa47si14914714edy.117.2022.11.09.19.25.02; Wed, 09 Nov 2022 19:25:58 -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 S232134AbiKJDPo (ORCPT + 66 others); Wed, 9 Nov 2022 22:15:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbiKJDPm (ORCPT ); Wed, 9 Nov 2022 22:15:42 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5676B1C911; Wed, 9 Nov 2022 19:15:41 -0800 (PST) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N76Qp2cBJzHvbv; Thu, 10 Nov 2022 11:15:14 +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 11:15:39 +0800 From: Xiu Jianfeng To: , , , , , CC: , , Subject: [PATCH v2] wifi: ath10k: Fix return value in ath10k_pci_init() Date: Thu, 10 Nov 2022 11:12:28 +0800 Message-ID: <20221110031228.247361-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: dggems706-chm.china.huawei.com (10.3.19.183) 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