From patchwork Wed Aug 1 15:54: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: 1265141 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C6035DF215 for ; Wed, 1 Aug 2012 16:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756070Ab2HAP7d (ORCPT ); Wed, 1 Aug 2012 11:59:33 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:59287 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755556Ab2HAP7b (ORCPT ); Wed, 1 Aug 2012 11:59:31 -0400 Received: by ggnl2 with SMTP id l2so180707ggn.19 for ; Wed, 01 Aug 2012 08:59:31 -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=F1RrwV6zQmqTQ6b7GiOxDMn9BuBS0JmnpT4U5v6Y22g=; b=YR4SQ9KAKw8X73pYcNE1yekNmBsdEGm04+XFmjkrCwcj9WRpGMpUN8uy++CkBsfYLk kEloS1lJw3bCx70xB0k0TI0P/YC2MuN5CkDz2/wh5XKv+8vbDAfXF5T6ImnO6bQK7K8X F2xqsZTlafmPzKJG7sy2NbnVSaBSvfHRe9SJwLgHg4dXLQaWgTby1norn4Q0lmOwybHb uNBCZCzAXmQt6UUPhaw/A+FAqLG+xpg4mnJ1arPi7bEnO/4JvLyWIALosuREoBEWirfd 64yQ6bCT/cZqDf67gH23EgcVKKXyF5e3RR3U/U3ITy3Ve9CIG3E2FVchwO28P3nvyjUf k19Q== Received: by 10.66.77.40 with SMTP id p8mr40753158paw.78.1343836771041; Wed, 01 Aug 2012 08:59:31 -0700 (PDT) Received: from localhost.localdomain ([58.250.81.2]) by mx.google.com with ESMTPS id pe8sm2816231pbc.76.2012.08.01.08.59.22 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Aug 2012 08:59:30 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile , Roland Dreier , Sean Hefty , Hal Rosenstock 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 26/32] PCI/mthca: use PCIe capabilities access functions to simplify implementation Date: Wed, 1 Aug 2012 23:54:31 +0800 Message-Id: <1343836477-7287-27-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 mthca driver's implementation. Signed-off-by: Jiang Liu Signed-off-by: Yijing Wang Acked-by: Roland Dreier --- drivers/infiniband/hw/mthca/mthca_reset.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/mthca/mthca_reset.c b/drivers/infiniband/hw/mthca/mthca_reset.c index 4fa3534..7b1a3bc 100644 --- a/drivers/infiniband/hw/mthca/mthca_reset.c +++ b/drivers/infiniband/hw/mthca/mthca_reset.c @@ -241,16 +241,16 @@ good: if (hca_pcie_cap) { devctl = hca_header[(hca_pcie_cap + PCI_EXP_DEVCTL) / 4]; - if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_DEVCTL, - devctl)) { + if (pci_pcie_capability_write_word(mdev->pdev, PCI_EXP_DEVCTL, + devctl)) { err = -ENODEV; mthca_err(mdev, "Couldn't restore HCA PCI Express " "Device Control register, aborting.\n"); goto out; } linkctl = hca_header[(hca_pcie_cap + PCI_EXP_LNKCTL) / 4]; - if (pci_write_config_word(mdev->pdev, hca_pcie_cap + PCI_EXP_LNKCTL, - linkctl)) { + if (pci_pcie_capability_write_word(mdev->pdev, PCI_EXP_LNKCTL, + linkctl)) { err = -ENODEV; mthca_err(mdev, "Couldn't restore HCA PCI Express " "Link control register, aborting.\n");