From: Rosen Penev <rosenp@gmail.com>
To: linux-pci@vger.kernel.org
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Ray Jui" <rjui@broadcom.com>,
"Scott Branden" <sbranden@broadcom.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM
IPROC ARM ARCHITECTURE), linux-kernel@vger.kernel.org (open list)
Subject: [PATCHv2] PCI: iproc: platform: use device functions instead of OF.
Date: Mon, 27 Jul 2026 16:44:08 -0700 [thread overview]
Message-ID: <20260727234408.296186-1-rosenp@gmail.com> (raw)
Since this is supposed to be the higher layer file, use higher layer
than OF to handle this. Remove OF headers as a result.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
v2: fix platform_get_resource() parameters.
drivers/pci/controller/pcie-iproc-platform.c | 31 ++++++++------------
1 file changed, 12 insertions(+), 19 deletions(-)
diff --git a/drivers/pci/controller/pcie-iproc-platform.c b/drivers/pci/controller/pcie-iproc-platform.c
index 4c9a0c4bb923..488ff737ec52 100644
--- a/drivers/pci/controller/pcie-iproc-platform.c
+++ b/drivers/pci/controller/pcie-iproc-platform.c
@@ -10,12 +10,8 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
-#include <linux/of_address.h>
-#include <linux/of_pci.h>
-#include <linux/of_platform.h>
#include <linux/phy/phy.h>
-#include "../pci.h"
#include "pcie-iproc.h"
static const struct of_device_id iproc_pcie_of_match_table[] = {
@@ -40,11 +36,14 @@ static int iproc_pltfm_pcie_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct iproc_pcie *pcie;
- struct device_node *np = dev->of_node;
- struct resource reg;
+ struct resource *reg;
struct pci_host_bridge *bridge;
int ret;
+ reg = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!reg)
+ return -ENODEV;
+
bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie));
if (!bridge)
return -ENOMEM;
@@ -52,26 +51,20 @@ static int iproc_pltfm_pcie_probe(struct platform_device *pdev)
pcie = pci_host_bridge_priv(bridge);
pcie->dev = dev;
- pcie->type = (uintptr_t)of_device_get_match_data(dev);
-
- ret = of_address_to_resource(np, 0, ®);
- if (ret < 0) {
- dev_err(dev, "unable to obtain controller resources\n");
- return ret;
- }
+ pcie->type = (uintptr_t)device_get_match_data(dev);
- pcie->base = devm_pci_remap_cfgspace(dev, reg.start,
- resource_size(®));
+ pcie->base = devm_pci_remap_cfgspace(dev, reg->start,
+ resource_size(reg));
if (!pcie->base) {
dev_err(dev, "unable to map controller registers\n");
return -ENOMEM;
}
- pcie->base_addr = reg.start;
+ pcie->base_addr = reg->start;
- if (of_property_read_bool(np, "brcm,pcie-ob")) {
+ if (device_property_present(dev, "brcm,pcie-ob")) {
u32 val;
- ret = of_property_read_u32(np, "brcm,pcie-ob-axi-offset",
+ ret = device_property_read_u32(dev, "brcm,pcie-ob-axi-offset",
&val);
if (ret) {
dev_err(dev,
@@ -87,7 +80,7 @@ static int iproc_pltfm_pcie_probe(struct platform_device *pdev)
* core driver. For platforms that require explicit inbound mapping
* configuration, "dma-ranges" would have been present in DT
*/
- pcie->need_ib_cfg = of_property_read_bool(np, "dma-ranges");
+ pcie->need_ib_cfg = device_property_present(dev, "dma-ranges");
/* PHY use is optional */
pcie->phy = devm_phy_optional_get(dev, "pcie-phy");
--
2.55.0
next reply other threads:[~2026-07-27 23:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 23:44 Rosen Penev [this message]
2026-07-27 23:48 ` [PATCHv2] PCI: iproc: platform: use device functions instead of OF sashiko-bot
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=20260727234408.296186-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=rjui@broadcom.com \
--cc=robh@kernel.org \
--cc=sbranden@broadcom.com \
/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.