From patchwork Wed Aug 1 15:54:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1265221 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 9CFB83FC23 for ; Wed, 1 Aug 2012 16:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755992Ab2HAP6V (ORCPT ); Wed, 1 Aug 2012 11:58:21 -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 S1755969Ab2HAP6T (ORCPT ); Wed, 1 Aug 2012 11:58:19 -0400 Received: by mail-yw0-f46.google.com with SMTP id m54so7458781yhm.19 for ; Wed, 01 Aug 2012 08:58:18 -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=hWHjJhG4zqoYlgbQHO97HByrBHWEwRUQxy4Gsb8Lr9Jcz7OU6CedO2cHcfJ8TVKdva k71havl2DDuFTlPRF8EHgB56iEXPBJ3HXiDA0mB95ZhO3UzZFRK8GLvIOx9Kv/GqezFT u3ke409tJZEBEDLQXRicCfV0ud3rg+zO7ZGmkX849Um/RUmHJnPj2PhwiRKbS453QQwM J3ZQ3YqaUqxt+2qlm34dRPD8qTS5mRJH3FOcn74tw0R5d+k8gQktrlRdmwXPw90uR6JS qYlv43pJeerK0HONuIBxfqYy7J1mJOyLGrFotB2U0tmpxddmqkclLUwF0YXA9EbEM8Ek dEqw== Received: by 10.66.81.202 with SMTP id c10mr40969548pay.20.1343836698455; Wed, 01 Aug 2012 08:58:18 -0700 (PDT) Received: from localhost.localdomain ([58.250.81.2]) by mx.google.com with ESMTPS id pe8sm2816231pbc.76.2012.08.01.08.58.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Aug 2012 08:58:18 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile , Jeff Kirsher 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 19/32] PCI/mlx4: use PCIe capabilities access functions to simplify implementation Date: Wed, 1 Aug 2012 23:54:24 +0800 Message-Id: <1343836477-7287-20-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 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");