From patchwork Thu Sep 5 07:55:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 2853964 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D1EF69F495 for ; Thu, 5 Sep 2013 08:00:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9AB420204 for ; Thu, 5 Sep 2013 08:00:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A35B20160 for ; Thu, 5 Sep 2013 08:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763358Ab3IEIAd (ORCPT ); Thu, 5 Sep 2013 04:00:33 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:34820 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757164Ab3IEIAb (ORCPT ); Thu, 5 Sep 2013 04:00:31 -0400 Received: from 172.24.2.119 (EHLO szxeml210-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BHC39997; Thu, 05 Sep 2013 15:57:04 +0800 (CST) Received: from SZXEML404-HUB.china.huawei.com (10.82.67.59) by szxeml210-edg.china.huawei.com (172.24.2.183) with Microsoft SMTP Server (TLS) id 14.1.323.7; Thu, 5 Sep 2013 15:57:01 +0800 Received: from localhost (10.135.76.69) by szxeml404-hub.china.huawei.com (10.82.67.59) with Microsoft SMTP Server id 14.1.323.7; Thu, 5 Sep 2013 15:56:56 +0800 From: Yijing Wang To: Benjamin Herrenschmidt , Bjorn Helgaas , "James E.J. Bottomley" CC: Gavin Shan , , , Yijing Wang , Hanjun Guo Subject: [PATCH v2 5/6] PCI: use pci_is_pcie() to simplify code Date: Thu, 5 Sep 2013 15:55:29 +0800 Message-ID: <1378367730-25996-5-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 In-Reply-To: <1378367730-25996-1-git-send-email-wangyijing@huawei.com> References: <1378367730-25996-1-git-send-email-wangyijing@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.135.76.69] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use pci_is_pcie() instead of pci_find_capability to simplify code. Signed-off-by: Yijing Wang --- drivers/pci/probe.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index eeb50bd..0fa9075 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -641,8 +641,7 @@ static void pci_set_bus_speed(struct pci_bus *bus) return; } - pos = pci_find_capability(bridge, PCI_CAP_ID_EXP); - if (pos) { + if (pci_is_pcie(bridge)) { u32 linkcap; u16 linksta;