From patchwork Tue Jul 24 16:31:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 172937 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 88A142C0081 for ; Wed, 25 Jul 2012 02:37:51 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754396Ab2GXQg3 (ORCPT ); Tue, 24 Jul 2012 12:36:29 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:42042 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753909Ab2GXQg0 (ORCPT ); Tue, 24 Jul 2012 12:36:26 -0400 Received: by yenl2 with SMTP id l2so6853339yen.19 for ; Tue, 24 Jul 2012 09:36:25 -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=ktAnu0NedNgVs9WDoprcPiHcHs+r5ioIMxtvHg+W+Vw=; b=t7qJ/da8EMK7wL/s5oLf8byrYoB3XYKRHayvJVSd8XrdYQwwNPpTsgxNZANPAjXL9b FmOzs5M7z8V1W8M4Vh4cZRY1K4bs+nFEUPMD1ubmox2LuExSSFfkbGoTyJWgwsPhmeUx jCe4ZL1OUEy5b1DkIvWCMGlaAWQA04RAGHAD8jDt7Wg6n7vqpkAvmgVXOwQ553ITQWjL msQ9Q8XOoMA6brZAZZEZ30JTWVobno0/CCGDMgs2Wj+1h7pey9LA/LYVAjy/qdSzZ74j KoYRWepe1sH3VobnoFb3dojW4F1u/MEzOgpywdqxIYMCvQf6wc2/L1yc8PVlf6R7nBZ2 MmXQ== Received: by 10.66.81.106 with SMTP id z10mr5906130pax.26.1343147785498; Tue, 24 Jul 2012 09:36:25 -0700 (PDT) Received: from localhost.localdomain ([221.221.26.244]) by mx.google.com with ESMTPS id wi6sm12457583pbc.35.2012.07.24.09.36.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 09:36:25 -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 19/32] PCI/mlx4: use PCIe capabilities access functions to simplify implementation Date: Wed, 25 Jul 2012 00:31:31 +0800 Message-Id: <1343147504-25891-20-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 mlx4 driver's implementation. Signed-off-by: Jiang Liu --- drivers/net/ethernet/mellanox/mlx4/reset.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/reset.c b/drivers/net/ethernet/mellanox/mlx4/reset.c index 11e7c1c..6895214 100644 --- a/drivers/net/ethernet/mellanox/mlx4/reset.c +++ b/drivers/net/ethernet/mellanox/mlx4/reset.c @@ -141,16 +141,16 @@ int mlx4_reset(struct mlx4_dev *dev) /* Now restore the PCI headers */ if (pcie_cap) { devctl = hca_header[(pcie_cap + PCI_EXP_DEVCTL) / 4]; - if (pci_write_config_word(dev->pdev, pcie_cap + PCI_EXP_DEVCTL, - devctl)) { + if (pci_pcie_capability_write_word(dev->pdev, PCI_EXP_DEVCTL, + devctl)) { err = -ENODEV; mlx4_err(dev, "Couldn't restore HCA PCI Express " "Device Control register, aborting.\n"); goto out; } linkctl = hca_header[(pcie_cap + PCI_EXP_LNKCTL) / 4]; - if (pci_write_config_word(dev->pdev, pcie_cap + PCI_EXP_LNKCTL, - linkctl)) { + if (pci_pcie_capability_write_word(dev->pdev, PCI_EXP_LNKCTL, + linkctl)) { err = -ENODEV; mlx4_err(dev, "Couldn't restore HCA PCI Express " "Link control register, aborting.\n");