From patchwork Wed Dec 5 20:57:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 1843041 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 7EF2ADF266 for ; Wed, 5 Dec 2012 20:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754505Ab2LEU5j (ORCPT ); Wed, 5 Dec 2012 15:57:39 -0500 Received: from mail-wg0-f74.google.com ([74.125.82.74]:50693 "EHLO mail-wg0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754260Ab2LEU5h (ORCPT ); Wed, 5 Dec 2012 15:57:37 -0500 Received: by mail-wg0-f74.google.com with SMTP id dt14so395140wgb.1 for ; Wed, 05 Dec 2012 12:57:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=YdpSK9Myjna8umPJnWmdLj7+btfiu7inq/vVFO3Vpjs=; b=OJBXxoAxJ8mrpe5VTVV5Mdat2acp6n1DonXavndVMJdpgh6X4YxwXuTKPlAaCIiTS3 bU8d+toy6Mk1jEAF4AbvRd4i/Z29HqJ4IWUDUpGK1KphjRadwwoBllQvy9fit5bPt+6/ +K4JbcvIHPQou1ny7iAq8WyTtBZOhMkGvErtXBr6cyqbRDg9TT8kUtC3SnlOzsroCBtM HQGBtf7w69n4UNKowHMOwhrdWFMKOBHwkXsllTXmnGavRXyBg/mcfsWs+s/96TQDDRap OIThWHmfQ/9E8RO933iTAz+LxG+tmnfWwHOCKpkw91vKRDbSx4bA3UTzyTBhUgVPevdH cQHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:to:from:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=YdpSK9Myjna8umPJnWmdLj7+btfiu7inq/vVFO3Vpjs=; b=jPD1b/CJ5Fe7YsPcRnQf4flOJtg26KPnrrhRs1tMqPikmc5Cuyu4Y5UNqOf+iah2ef E1Jf9CTaplA6D9jMMhZqokLERMpl/dlniC15P2X08rldw1NMCi1hHt1MrQvQsmkgvBjq UoBDJ9t1qBD4I8rjRmeT0jikIvTSOLrnScCFmhu91+KOWMy5q10Bw/mEarMzTNe6Lu/J JAswrsJ6vadnLPVwNMoI0dRVYrY7HmqYDrUTN+TExkA9dpgXHRlsHmj+AALNjpeaeynV tKhDpuRee5rSggF2J7yDWVmYueiSmEglD33JLMBFBwrZdpkrY8XmBOIA7ugVfq/7gc5o QgKg== Received: by 10.14.180.2 with SMTP id i2mr19278845eem.1.1354741056439; Wed, 05 Dec 2012 12:57:36 -0800 (PST) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id g9si764916eeo.1.2012.12.05.12.57.36 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 05 Dec 2012 12:57:36 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.17.131.112]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 17AF4200059; Wed, 5 Dec 2012 12:57:36 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 71FD6180280; Wed, 5 Dec 2012 12:57:35 -0800 (PST) Subject: [PATCH 03/12] PCI/portdrv: Use PCI Express Capability accessors To: linux-pci@vger.kernel.org From: Bjorn Helgaas Cc: Jiang Liu Date: Wed, 05 Dec 2012 13:57:35 -0700 Message-ID: <20121205205735.13851.23975.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20121205205724.13851.50508.stgit@bhelgaas.mtv.corp.google.com> References: <20121205205724.13851.50508.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnpPKuace6W8xZWwHsjQG28uCozaHCdtPXNCf7G/wrTRAm1KrSDOlXmgvwApkWPEO/1+Y/aQSObIyezg+B3wmGa+av0/4Hv6rqLQefMY3h5eSAdFMXki6vrtlqi0nUytsYZ1SOGdM1+23R7CUZY8B1YZO/M03WLQj2cCZ9SNVeC3TqG29nlwLK8qZwyOAMerNT31gMgmDefr8HW2+idgXWhIxptIA== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Use PCI Express Capability access functions to simplify portdrv. Signed-off-by: Bjorn Helgaas CC: Jiang Liu --- drivers/pci/pcie/portdrv_core.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index d03a7a3..70d3555 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -120,8 +120,7 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask) * the value in this field indicates which MSI-X Table entry is * used to generate the interrupt message." */ - pos = pci_pcie_cap(dev); - pci_read_config_word(dev, pos + PCI_EXP_FLAGS, ®16); + pcie_capability_read_word(dev, PCI_EXP_FLAGS, ®16); entry = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9; if (entry >= nr_entries) goto Error;