From patchwork Sat Mar 7 07:14:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Li X-Patchwork-Id: 1250838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=uniontech.com Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48ZG3w73mJz9sRN for ; Sat, 7 Mar 2020 18:15:48 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id DC9E73C62CC for ; Sat, 7 Mar 2020 08:15:37 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id B59583C2016 for ; Sat, 7 Mar 2020 08:15:33 +0100 (CET) Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.198]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id B9C7F1401159 for ; Sat, 7 Mar 2020 08:15:25 +0100 (CET) Received: from localhost (unknown [192.168.167.16]) by regular1.263xmail.com (Postfix) with ESMTP id 6F35425F for ; Sat, 7 Mar 2020 15:15:19 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-SKE-CHECKED: 1 X-ABS-CHECKED: 1 Received: from manjaro.uniontech.com (unknown [58.246.122.242]) by smtp.263.net (postfix) whith ESMTP id P18966T140133275780864S1583565310423463_; Sat, 07 Mar 2020 15:15:20 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: chenli@uniontech.com X-SENDER: chenli@uniontech.com X-LOGIN-NAME: chenli@uniontech.com X-FST-TO: ltp@lists.linux.it X-SENDER-IP: 58.246.122.242 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 Date: Sat, 07 Mar 2020 15:14:52 +0800 Message-ID: <87mu8smyab.wl-chenli@uniontech.com> From: Chen Li To: ltp@lists.linux.it User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/28.0 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] Subject: [PATCH] Update legacy codes in ltp_tpci.c X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The kernel api used in ltp_tpci.c is too old and connot pass compile after 3.12. Signed-off-by: Li Chen --- .../device-drivers/pci/tpci_kernel/ltp_tpci.c | 30 ++----------------- 1 file changed, 2 insertions(+), 28 deletions(-) -- 2.25.0 diff --git a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c index 2cf8cefc8..7cbabfaa5 100644 --- a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c +++ b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c @@ -61,7 +61,7 @@ MODULE_LICENSE("GPL"); #define TFAIL 1 #define TSKIP 32 -static DEFINE_PCI_DEVICE_TABLE(ltp_pci_tbl) = { +static const struct pci_device_id ltp_pci_tbl[] = { { PCI_DEVICE(PCI_ANY_ID, PCI_ANY_ID) }, { 0, } }; @@ -104,7 +104,7 @@ static int probe_pci_dev(unsigned int bus, unsigned int slot) ltp_pci.dev = NULL; } - dev = pci_get_bus_and_slot(bus, slot); + dev = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), bus, slot); if (!dev || !dev->driver) return -ENODEV; @@ -360,29 +360,6 @@ static int test_bus_add_devices(void) return TFAIL; } -/* - * test_enable_bridges - * make call to pci_enable_bridges, - * use bus pointer from the ltp_pci - * structure - */ -static int test_enable_bridges(void) -{ - struct pci_bus *bus = ltp_pci.bus; - - prk_info("enable bridges"); - - pci_enable_bridges(bus); - - if (bus) { - prk_info("called enable bridges"); - return TPASS; - } - - prk_err("enable_bridges failed"); - return TFAIL; -} - /* * test_match_device * make call to pci_match_device, returns a @@ -609,9 +586,6 @@ static int test_case(unsigned int cmd) case BUS_ADD_DEVICES: rc = test_bus_add_devices(); break; - case ENABLE_BRIDGES: - rc = test_enable_bridges(); - break; case MATCH_DEVICE: rc = test_match_device(); break;