From patchwork Wed Aug 1 15:54:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1265231 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2AD8E3FC23 for ; Wed, 1 Aug 2012 16:02:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755968Ab2HAP6P (ORCPT ); Wed, 1 Aug 2012 11:58:15 -0400 Received: from mail-yw0-f46.google.com ([209.85.213.46]:50358 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755969Ab2HAP6L (ORCPT ); Wed, 1 Aug 2012 11:58:11 -0400 Received: by yhmm54 with SMTP id m54so7458781yhm.19 for ; Wed, 01 Aug 2012 08:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=UKjB9V+MyeVWJseu79HwVivXpxw5BD02sdwGuLhCm2g=; b=ITq0Rv7q1F4TZpngx7yNAjPHoKPLVrjhkVVkx7VyaRB+d49D0hjReTGRx9pSMVF3Xq JQ97zizezgBNM+oVDrcgxbTDC2MRI+HwZyJE16KJxAfQLtjA2SlPnHP205tCtyXKTK9v aPAyj6xaPulBJKmZnOCAOm2snMhUC/03G/F7KCPu8C2nbIX0QB0LwH2yPq4wi7P23dOD srdKKBPvTUNkqJMejNyuPuYzQW5HTSeYYXees36/6G1U4e6be9X4h8H4zL4g/hUasXix BB5Bnq6HvP5aj1tw8v3y9KxMTBrb4Gz9cPJIgSTycwpYX5k/mkY9qSLZsaHQ2lxcb/bj o4oQ== Received: by 10.68.203.40 with SMTP id kn8mr52631904pbc.162.1343836690393; Wed, 01 Aug 2012 08:58:10 -0700 (PDT) Received: from localhost.localdomain ([58.250.81.2]) by mx.google.com with ESMTPS id pe8sm2816231pbc.76.2012.08.01.08.58.01 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Aug 2012 08:58:09 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile , Jon Mason Cc: Jiang Liu , Yinghai Lu , Taku Izumi , "Rafael J . Wysocki" , Kenji Kaneshige , Yijing Wang , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Jiang Liu Subject: [PATCH v3 18/32] PCI/vxge: use PCIe capabilities access functions to simplify implementation Date: Wed, 1 Aug 2012 23:54:23 +0800 Message-Id: <1343836477-7287-19-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343836477-7287-1-git-send-email-jiang.liu@huawei.com> References: <1343836477-7287-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Jiang Liu Use PCIe capabilities access functions to simplify vxge driver's implementation. Signed-off-by: Jiang Liu --- drivers/net/ethernet/neterion/vxge/vxge-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c index 98e2c10..f83f0a4 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-config.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c @@ -757,7 +757,7 @@ __vxge_hw_verify_pci_e_info(struct __vxge_hw_device *hldev) u16 lnk; /* Get the negotiated link width and speed from PCI config space */ - pci_read_config_word(dev, dev->pcie_cap + PCI_EXP_LNKSTA, &lnk); + pci_pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnk); if ((lnk & PCI_EXP_LNKSTA_CLS) != 1) return VXGE_HW_ERR_INVALID_PCI_INFO; @@ -1982,7 +1982,7 @@ u16 vxge_hw_device_link_width_get(struct __vxge_hw_device *hldev) struct pci_dev *dev = hldev->pdev; u16 lnk; - pci_read_config_word(dev, dev->pcie_cap + PCI_EXP_LNKSTA, &lnk); + pci_pcie_capability_read_word(dev, PCI_EXP_LNKSTA, &lnk); return (lnk & VXGE_HW_PCI_EXP_LNKCAP_LNK_WIDTH) >> 4; }