From patchwork Wed Aug 1 15:54:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1265081 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 0FC10DF215 for ; Wed, 1 Aug 2012 16:01:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756116Ab2HAQAl (ORCPT ); Wed, 1 Aug 2012 12:00:41 -0400 Received: from mail-gg0-f174.google.com ([209.85.161.174]:40535 "EHLO mail-gg0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755880Ab2HAQAh (ORCPT ); Wed, 1 Aug 2012 12:00:37 -0400 Received: by mail-gg0-f174.google.com with SMTP id l2so181856ggn.19 for ; Wed, 01 Aug 2012 09:00:37 -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=ZJ3IHSbXeX/0O/1cON10BhnlJv3upTa5vgvnWFVfOtU=; b=kVvZ3Mh9Y+la0C+StDpTFr6i0CTi+s56a0dyrnG9NwE/OhnDO94Fxl0/SkrCnN/+sr VX0yIg0MdxFNeguoAg18u4UsDe3f9wKdhaOmfqShwBsJChE3BxygC+aHAnZaYy0idL3f Ef3UOT/1PqHEX5Fgr8CYbC17VtFjNfW7lxNAa4JWrkOQRhpkkpcmkRYQZHU5KBraPqJg DX7jxaPYt1TQNfmMSxNh7thfswhpadQSeTCgNqnDfs4uUdM0+Xg6QrGZDEUBlTJYtb8h eFOhYGisM0iJtWl5sKI3jtD1wZEqNwLugWGApKepSzfs8XhNiKVLoA4P9MqYCVnz7nV0 cUGw== Received: by 10.66.73.133 with SMTP id l5mr40697843pav.74.1343836836780; Wed, 01 Aug 2012 09:00:36 -0700 (PDT) Received: from localhost.localdomain ([58.250.81.2]) by mx.google.com with ESMTPS id pe8sm2816231pbc.76.2012.08.01.09.00.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Aug 2012 09:00:33 -0700 (PDT) From: Jiang Liu To: Bjorn Helgaas , Don Dutile , Larry Finger , Mike McCormack 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 32/32] PCI/rtl8192e: use PCIe capabilities access functions to simplify implementation Date: Wed, 1 Aug 2012 23:54:37 +0800 Message-Id: <1343836477-7287-33-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 rtl8192e driver's implementation. Signed-off-by: Jiang Liu --- drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c index ddadcc3..820cc68 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c @@ -31,12 +31,10 @@ static void rtl8192_parse_pci_configuration(struct pci_dev *pdev, struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); u8 tmp; - int pos; - u8 LinkCtrlReg; + u16 LinkCtrlReg; - pos = pci_find_capability(priv->pdev, PCI_CAP_ID_EXP); - pci_read_config_byte(priv->pdev, pos + PCI_EXP_LNKCTL, &LinkCtrlReg); - priv->NdisAdapter.LinkCtrlReg = LinkCtrlReg; + pci_pcie_capability_read_word(priv->pdev, PCI_EXP_LNKCTL, &LinkCtrlReg); + priv->NdisAdapter.LinkCtrlReg = (u8)LinkCtrlReg; RT_TRACE(COMP_INIT, "Link Control Register =%x\n", priv->NdisAdapter.LinkCtrlReg);