From patchwork Tue Jul 24 16:41:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1232611 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 B4D00DF25A for ; Tue, 24 Jul 2012 16:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755468Ab2GXQnk (ORCPT ); Tue, 24 Jul 2012 12:43:40 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:64865 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755496Ab2GXQnj (ORCPT ); Tue, 24 Jul 2012 12:43:39 -0400 Received: by mail-pb0-f46.google.com with SMTP id rp8so12926361pbb.19 for ; Tue, 24 Jul 2012 09:43:38 -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=DFpvempYSAkKaO5Jm2X+7xrgA/dWCL1bmzuaf6TEYolSE1q7RCO+72x5nzj2alBtE+ Ohz4if+7DcQMTQKo6gwPmXcaqetvd2eyRUMCYoG79Mk3v0R0Li1Hc59OZj5z1v6hwhLQ +rnHIWjSK7TrqyGRCHoAZtbuJNq58THNogH01GSj7/3cER7u6u2icmPAndNc/VkGs4of O+4VIdjfHCfJS0KFyIrUDXKnmMUfcGe/saphv303gQ6OKs+zjT3vWPVfm1rpFgsd0kdA l7aUK46bVAFemYGdW3HrnmAK0Zz+flZE1DBZ6UnG06w4jBCcG3WY/CK7vAFE3L5Z6yUy d99Q== Received: by 10.68.217.3 with SMTP id ou3mr46318255pbc.117.1343148218786; Tue, 24 Jul 2012 09:43:38 -0700 (PDT) Received: from localhost.localdomain ([221.221.26.244]) by mx.google.com with ESMTPS id wk10sm7863878pbc.71.2012.07.24.09.43.30 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jul 2012 09:43:38 -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 26/32] PCI/mthca: use PCIe capabilities access functions to simplify implementation Date: Wed, 25 Jul 2012 00:41:11 +0800 Message-Id: <1343148077-25941-3-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343148077-25941-1-git-send-email-jiang.liu@huawei.com> References: <1343148077-25941-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 --- 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");