From patchwork Tue Jul 24 16:31:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1232271 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 933B33FD4F for ; Tue, 24 Jul 2012 16:37:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932116Ab2GXQgT (ORCPT ); Tue, 24 Jul 2012 12:36:19 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:39412 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932108Ab2GXQgR (ORCPT ); Tue, 24 Jul 2012 12:36:17 -0400 Received: by mail-pb0-f46.google.com with SMTP id rp8so12916328pbb.19 for ; Tue, 24 Jul 2012 09:36:16 -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=0tL5nTiL4yj5aVuIU+QbXZ1iWeyYzmHmn4cSf1OF8O2g9Kh5OZDBQoT7cri0rNctwb zQS4hojb0OSQ5hSL5sdEUNGr0+68HSFhLhePGixxZKchFTiAu9WE1WxlacW/pEI09pm6 nMiEJ+gaknkU3JTppHYm8wPO7GHMw8Z63CMMFe1sw1ayhrX7PoaODu/W1l0gms4BRIgW ib6vE5bCFkkOX1X2WUGgZGGnTenw7ORMW50rLWeci0dtqRmmjJk1trUkPJU9GmQsfjPg A+2gSmRioQdY7KAJJk+OLpO8Rf3jb0rs3hBM14yPcmn9AuoRh4FCDjWYobYEl/nlZPcj YSTw== Received: by 10.68.203.98 with SMTP id kp2mr45689829pbc.132.1343147776846; Tue, 24 Jul 2012 09:36:16 -0700 (PDT) Received: from localhost.localdomain ([221.221.26.244]) by mx.google.com with ESMTPS id wi6sm12457583pbc.35.2012.07.24.09.36.08 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 09:36:16 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile 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: [RFC PATCH v2 18/32] PCI/vxge: use PCIe capabilities access functions to simplify implementation Date: Wed, 25 Jul 2012 00:31:30 +0800 Message-Id: <1343147504-25891-19-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343147504-25891-1-git-send-email-jiang.liu@huawei.com> References: <1343147504-25891-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; }