Received: with ECARTIS (v1.0.0; list netdev); Sun, 06 Mar 2005 02:33:38 -0800 (PST) Received: from trashy.coderock.org (postfix@coderock.org [193.77.147.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j26AXTsg019425 for ; Sun, 6 Mar 2005 02:33:30 -0800 Received: by trashy.coderock.org (Postfix, from userid 780) id 1257E1F23D; Sun, 6 Mar 2005 11:33:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 828671F208; Sun, 6 Mar 2005 11:33:27 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by trashy.coderock.org (Postfix) with ESMTP id 3155B1E46E; Sun, 6 Mar 2005 11:33:12 +0100 (CET) Subject: [patch 11/26] janitor: net/tg3: pci_find_device to pci_dev_present To: jgarzik@pobox.com Cc: netdev@oss.sgi.com, domen@coderock.org, sfeldma@pobox.com, janitor@sternwelten.at From: domen@coderock.org Date: Sun, 06 Mar 2005 11:33:11 +0100 Message-Id: <20050306103312.3155B1E46E@trashy.coderock.org> X-Virus-Scanned: ClamAV 0.83/748/Fri Mar 4 14:19:11 2005 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 2492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: domen@coderock.org Precedence: bulk X-list: netdev Content-Length: 2084 Lines: 56 Replace pci_find_device with pci_dev_present. Compile tested. Signed-off-by: Scott Feldman Signed-off-by: Maximilian Attems Signed-off-by: Domen Puncer --- kj-domen/drivers/net/tg3.c | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff -puN drivers/net/tg3.c~remove-pci-find-device-drivers_net_tg3 drivers/net/tg3.c --- kj/drivers/net/tg3.c~remove-pci-find-device-drivers_net_tg3 2005-03-05 16:09:45.000000000 +0100 +++ kj-domen/drivers/net/tg3.c 2005-03-05 16:09:45.000000000 +0100 @@ -7829,6 +7829,19 @@ static int __devinit tg3_is_sun_570X(str static int __devinit tg3_get_invariants(struct tg3 *tp) { + static struct pci_device_id write_reorder_chipsets[] = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801AA_8) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801AB_8) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801BA_11) }, + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801BA_6) }, + { PCI_DEVICE(PCI_VENDOR_ID_AMD, + PCI_DEVICE_ID_AMD_FE_GATE_700C) }, + { }, + }; u32 misc_ctrl_reg; u32 cacheline_sz_reg; u32 pci_state_reg, grc_misc_cfg; @@ -7847,16 +7860,7 @@ static int __devinit tg3_get_invariants( * every mailbox register write to force the writes to be * posted to the chip in order. */ - if (pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801AA_8, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801AB_8, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801BA_11, NULL) || - pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82801BA_6, NULL) || - pci_find_device(PCI_VENDOR_ID_AMD, - PCI_DEVICE_ID_AMD_FE_GATE_700C, NULL)) + if (pci_dev_present(write_reorder_chipsets)) tp->tg3_flags |= TG3_FLAG_MBOX_WRITE_REORDER; /* Force memory write invalidate off. If we leave it on, _