All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fan Fei <ffclaire1224@gmail.com>
To: bjorn@helgaas.com
Cc: Fan Fei <ffclaire1224@gmail.com>, linux-pci@vger.kernel.org
Subject: [PATCH 09/13] PCI: ftpci100: Replace device * with platform_device *
Date: Sat, 27 Nov 2021 15:11:17 +0100	[thread overview]
Message-ID: <0d49eb261d6cd7a69c98280a50f9db90e2e8fd75.1638022049.git.ffclaire1224@gmail.com> (raw)
In-Reply-To: <cover.1638022048.git.ffclaire1224@gmail.com>

Some PCI controller struct contain "device *", while others contain
"platform_device *". Unify "device *dev" to "platform_device *pdev" in
struct faraday_pci, because PCI controllers interact with platform_device
directly, not device, to enumerate the controlled device.

Signed-off-by: Fan Fei <ffclaire1224@gmail.com>
---
 drivers/pci/controller/pci-ftpci100.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/controller/pci-ftpci100.c b/drivers/pci/controller/pci-ftpci100.c
index 88980a44461d..64e4405ad0be 100644
--- a/drivers/pci/controller/pci-ftpci100.c
+++ b/drivers/pci/controller/pci-ftpci100.c
@@ -120,7 +120,7 @@ struct faraday_pci_variant {
 };
 
 struct faraday_pci {
-	struct device *dev;
+	struct platform_device *pdev;
 	void __iomem *base;
 	struct irq_domain *irqdomain;
 	struct pci_bus *bus;
@@ -342,19 +342,20 @@ static const struct irq_domain_ops faraday_pci_irqdomain_ops = {
 
 static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p)
 {
-	struct device_node *intc = of_get_next_child(p->dev->of_node, NULL);
+	struct device *dev = &p->pdev->dev;
+	struct device_node *intc = of_get_next_child(dev->of_node, NULL);
 	int irq;
 	int i;
 
 	if (!intc) {
-		dev_err(p->dev, "missing child interrupt-controller node\n");
+		dev_err(dev, "missing child interrupt-controller node\n");
 		return -EINVAL;
 	}
 
 	/* All PCI IRQs cascade off this one */
 	irq = of_irq_get(intc, 0);
 	if (irq <= 0) {
-		dev_err(p->dev, "failed to get parent IRQ\n");
+		dev_err(dev, "failed to get parent IRQ\n");
 		of_node_put(intc);
 		return irq ?: -EINVAL;
 	}
@@ -363,7 +364,7 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p)
 					     &faraday_pci_irqdomain_ops, p);
 	of_node_put(intc);
 	if (!p->irqdomain) {
-		dev_err(p->dev, "failed to create Gemini PCI IRQ domain\n");
+		dev_err(dev, "failed to create Gemini PCI IRQ domain\n");
 		return -EINVAL;
 	}
 
@@ -377,7 +378,7 @@ static int faraday_pci_setup_cascaded_irq(struct faraday_pci *p)
 
 static int faraday_pci_parse_map_dma_ranges(struct faraday_pci *p)
 {
-	struct device *dev = p->dev;
+	struct device *dev = &p->pdev->dev;
 	struct pci_host_bridge *bridge = pci_host_bridge_from_priv(p);
 	struct resource_entry *entry;
 	u32 confreg[3] = {
@@ -439,7 +440,7 @@ static int faraday_pci_probe(struct platform_device *pdev)
 	host->ops = &faraday_pci_ops;
 	p = pci_host_bridge_priv(host);
 	host->sysdata = p;
-	p->dev = dev;
+	p->pdev = pdev;
 
 	/* Retrieve and enable optional clocks */
 	clk = devm_clk_get(dev, "PCLK");
-- 
2.25.1


  parent reply	other threads:[~2021-11-27 14:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-27 14:11 [PATCH 00/13] Unify device * to platform_device * Fan Fei
2021-11-27 14:11 ` [PATCH 01/13] PCI: xilinx: Replace device * with " Fan Fei
2021-11-27 14:11 ` [PATCH 02/13] PCI: mediatek: " Fan Fei
2021-11-27 14:11 ` [PATCH 03/13] PCI: tegra: " Fan Fei
2021-11-27 14:11 ` [PATCH 04/13] PCI: xegene: " Fan Fei
2021-11-27 14:11 ` [PATCH 05/13] PCI: microchip: " Fan Fei
2021-11-27 14:11 ` [PATCH 06/13] PCI: brcmstb: " Fan Fei
2021-11-27 14:11 ` [PATCH 07/13] PCI: mediatek-gen3: " Fan Fei
2021-11-27 14:11 ` [PATCH 08/13] PCI: rcar-gen2: " Fan Fei
2021-11-27 14:11 ` Fan Fei [this message]
2021-11-27 14:11 ` [PATCH 10/13] PCI: v3-semi: " Fan Fei
2021-11-27 14:11 ` [PATCH 11/13] PCI: ixp4xx: " Fan Fei
2021-11-27 14:11 ` [PATCH 12/13] PCI: xilinx-nwl: " Fan Fei
2021-11-27 14:11 ` [PATCH 13/13] PCI: rcar: " Fan Fei
2021-12-23  0:43 ` [PATCH 00/13] Unify device * to " Bjorn Helgaas
2021-12-28 19:38   ` Fan Fei
2021-12-29 17:14     ` 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=0d49eb261d6cd7a69c98280a50f9db90e2e8fd75.1638022049.git.ffclaire1224@gmail.com \
    --to=ffclaire1224@gmail.com \
    --cc=bjorn@helgaas.com \
    --cc=linux-pci@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.