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 4/7] PCI: dra7xx: Prefer of_device_get_match_data() over of_match_device()
Date: Tue, 23 Nov 2021 16:37:59 +0100	[thread overview]
Message-ID: <e5ee4df18f3ec1e4fff4f32c498e76fa612c3097.1637678104.git.ffclaire1224@gmail.com> (raw)
In-Reply-To: <cover.1637678103.git.ffclaire1224@gmail.com>

The dra7xx PCI controller driver only needs "struct dra7xx_pcie_of_data *"
during probe(). Replace of_match_device(), which returns
"struct of_device_id *", with of_device_get_match_data(), to get
"struct dra7xx_pcie_of_data *" directly.

Signed-off-by: Fan Fei <ffclaire1224@gmail.com>
---
 drivers/pci/controller/dwc/pci-dra7xx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index a4221f6f3629..12d19183e746 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -697,16 +697,14 @@ static int dra7xx_pcie_probe(struct platform_device *pdev)
 	struct device_node *np = dev->of_node;
 	char name[10];
 	struct gpio_desc *reset;
-	const struct of_device_id *match;
 	const struct dra7xx_pcie_of_data *data;
 	enum dw_pcie_device_mode mode;
 	u32 b1co_mode_sel_mask;
 
-	match = of_match_device(of_match_ptr(of_dra7xx_pcie_match), dev);
-	if (!match)
+	data = of_device_get_match_data(dev);
+	if (!data)
 		return -EINVAL;
 
-	data = (struct dra7xx_pcie_of_data *)match->data;
 	mode = (enum dw_pcie_device_mode)data->mode;
 	b1co_mode_sel_mask = data->b1co_mode_sel_mask;
 
-- 
2.25.1


  parent reply	other threads:[~2021-11-23 15:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 15:37 [PATCH 0/7] PCI: Prefer of_device_get_match_data() over of_match_device() Fan Fei
2021-11-23 15:37 ` [PATCH 1/7] PCI: altera: " Fan Fei
2021-11-23 15:37 ` [PATCH 2/7] PCI: cadence: " Fan Fei
2021-11-23 15:37 ` [PATCH 3/7] PCI: kirin: " Fan Fei
2021-11-23 15:37 ` Fan Fei [this message]
2021-11-23 15:38 ` [PATCH 5/7] PCI: keystone: " Fan Fei
2021-11-23 15:38 ` [PATCH 6/7] PCI: artpec6: " Fan Fei
2021-11-23 15:38 ` [PATCH 7/7] PCI: dwc: Prefer of_device_get_match_data() over of_device_device() Fan Fei
2021-12-08 20:50 ` [PATCH 0/7] PCI: Prefer of_device_get_match_data() over of_match_device() Bjorn Helgaas
2021-12-08 20:50   ` Bjorn Helgaas
2021-12-08 21:21   ` Bjorn Helgaas
2021-12-08 21:21     ` 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=e5ee4df18f3ec1e4fff4f32c498e76fa612c3097.1637678104.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.