linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Oded Gabbay" <oded.gabbay@gmail.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David (ChunMing) Zhou" <David1.Zhou@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Joerg Roedel" <joro@8bytes.org>,
	"David Woodhouse" <dwmw2@infradead.org>,
	"Realtek linux nic maintainers" <nic_swsd@realtek.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Giuseppe Cavallaro" <peppe.cavallaro@st.com>,
	"Alexandre Torgue" <alexandre.torgue@st.com>,
	"Jose Abreu" <joabreu@synopsys.com>,
	"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Benson Leung" <bleung@chromium.org>,
	"Enric Balletbo i Serra" <enric.balletbo@collabora.com>,
	"Stephen Rothwell" <sfr@canb.auug.org.au>,
	"Paul Mackerras" <paulus@samba.org>
Cc: open list <linux-kernel@vger.kernel.org>,
	"open list:AMD KFD" <dri-devel@lists.freedesktop.org>,
	"open list:RADEON and AMDGPU DRM DRIVERS" 
	<amd-gfx@lists.freedesktop.org>,
	"open list:AMD IOMMU (AMD-VI)" <iommu@lists.linux-foundation.org>,
	"open list:8169 10/100/1000 GIGABIT ETHERNET DRIVER" 
	<netdev@vger.kernel.org>,
	"moderated list:ARM/STM32 ARCHITECTURE" 
	<linux-stm32@st-md-mailman.stormreply.com>,
	"moderated list:ARM/STM32 ARCHITECTURE" 
	<linux-arm-kernel@lists.infradead.org>,
	"open list:PCI SUBSYSTEM" <linux-pci@vger.kernel.org>
Subject: [PATCH v2 4/9] powerpc/powernv/npu: use helper pci_dev_id
Date: Wed, 24 Apr 2019 21:14:25 +0200	[thread overview]
Message-ID: <8ed5b4ee-3226-6786-eb96-886826e180cd@gmail.com> (raw)
In-Reply-To: <2e1f9a57-6d08-d017-24da-3e6b97fa2449@gmail.com>

Use new helper pci_dev_id() to simplify the code.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 arch/powerpc/platforms/powernv/npu-dma.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
index dc23d9d2a..495550432 100644
--- a/arch/powerpc/platforms/powernv/npu-dma.c
+++ b/arch/powerpc/platforms/powernv/npu-dma.c
@@ -1213,9 +1213,8 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid,
 	 * Currently we only support radix and non-zero LPCR only makes sense
 	 * for hash tables so skiboot expects the LPCR parameter to be a zero.
 	 */
-	ret = opal_npu_map_lpar(nphb->opal_id,
-			PCI_DEVID(gpdev->bus->number, gpdev->devfn), lparid,
-			0 /* LPCR bits */);
+	ret = opal_npu_map_lpar(nphb->opal_id, pci_dev_id(gpdev), lparid,
+				0 /* LPCR bits */);
 	if (ret) {
 		dev_err(&gpdev->dev, "Error %d mapping device to LPAR\n", ret);
 		return ret;
@@ -1224,7 +1223,7 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid,
 	dev_dbg(&gpdev->dev, "init context opalid=%llu msr=%lx\n",
 			nphb->opal_id, msr);
 	ret = opal_npu_init_context(nphb->opal_id, 0/*__unused*/, msr,
-			PCI_DEVID(gpdev->bus->number, gpdev->devfn));
+				    pci_dev_id(gpdev));
 	if (ret < 0)
 		dev_err(&gpdev->dev, "Failed to init context: %d\n", ret);
 	else
@@ -1258,7 +1257,7 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev)
 	dev_dbg(&gpdev->dev, "destroy context opalid=%llu\n",
 			nphb->opal_id);
 	ret = opal_npu_destroy_context(nphb->opal_id, 0/*__unused*/,
-			PCI_DEVID(gpdev->bus->number, gpdev->devfn));
+				       pci_dev_id(gpdev));
 	if (ret < 0) {
 		dev_err(&gpdev->dev, "Failed to destroy context: %d\n", ret);
 		return ret;
@@ -1266,9 +1265,8 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev)
 
 	/* Set LPID to 0 anyway, just to be safe */
 	dev_dbg(&gpdev->dev, "Map LPAR opalid=%llu lparid=0\n", nphb->opal_id);
-	ret = opal_npu_map_lpar(nphb->opal_id,
-			PCI_DEVID(gpdev->bus->number, gpdev->devfn), 0 /*LPID*/,
-			0 /* LPCR bits */);
+	ret = opal_npu_map_lpar(nphb->opal_id, pci_dev_id(gpdev), 0 /*LPID*/,
+				0 /* LPCR bits */);
 	if (ret)
 		dev_err(&gpdev->dev, "Error %d mapping device to LPAR\n", ret);
 
-- 
2.21.0



  parent reply	other threads:[~2019-04-24 19:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 19:10 [PATCH v2 0/9] PCI: add help pci_dev_id Heiner Kallweit
2019-04-24 19:11 ` [PATCH v2 1/9] PCI: add helper pci_dev_id Heiner Kallweit
2019-04-24 19:12 ` [PATCH v2 2/9] PCI: use " Heiner Kallweit
2019-04-24 19:13 ` [PATCH v2 3/9] r8169: use new " Heiner Kallweit
2019-04-24 19:14 ` Heiner Kallweit [this message]
2019-04-26  3:44   ` [PATCH v2 4/9] powerpc/powernv/npu: use " Alexey Kardashevskiy
2019-04-24 19:14 ` [PATCH v2 5/9] drm/amdkfd: " Heiner Kallweit
2019-04-25  6:57   ` Koenig, Christian
2019-04-24 19:15 ` [PATCH v2 6/9] iommu/amd: " Heiner Kallweit
2019-04-26 13:47   ` Joerg Roedel
2019-04-24 19:16 ` [PATCH v2 7/9] iommu/vt-d: " Heiner Kallweit
2019-04-26 13:47   ` Joerg Roedel
2019-04-24 19:16 ` [PATCH v2 8/9] stmmac: pci: " Heiner Kallweit
2019-04-24 19:17 ` [PATCH v2 9/9] platform/chrome: chromeos_laptop: " Heiner Kallweit
2019-04-25 18:21   ` Benson Leung
2019-04-29 21:14 ` [PATCH v2 0/9] PCI: add help pci_dev_id Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ed5b4ee-3226-6786-eb96-886826e180cd@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=David1.Zhou@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=alexandre.torgue@st.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=bleung@chromium.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=davem@davemloft.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=dwmw2@infradead.org \
    --cc=enric.balletbo@collabora.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joabreu@synopsys.com \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=oded.gabbay@gmail.com \
    --cc=paulus@samba.org \
    --cc=peppe.cavallaro@st.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).