From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62E943C583A for ; Mon, 27 Jul 2026 23:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785195853; cv=none; b=rOIO+Ph7IHD0vxMKGiW3GcvMQ3o39ZHRrGrapWKrhQVHbAzsu1yORRZPIfZ/F+BezbvrX3IFuVIm3teZ6LJ2keX88WQw4uX5V4swBDSavAXt3WpNZJaNROJFvVLknvDVfP/zcrEQfHmKZzVptmAls8+GadDFfjINoMeVJrS/3OU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785195853; c=relaxed/simple; bh=oQiO8LuB4o9YTwTiwf50U8fjZhOlqBBbq+6KnJ4AqQY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Kld9peVtETRqy9naHwQLNK6RZQB4mhvTO32virjyMmyuubXcBwiJUOl6JGHkaaC2A92Vr2KgC2drqVEawSKd1rzM4MnmSevpdL163FzUoNV9rw3J55eohHkrE5793CqWCkBFncl4Ly7eYqjJemtQTrb+R5lMpA935b+127gpv60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dDRK2NS3; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dDRK2NS3" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-8f1e274ccb9so21284086d6.2 for ; Mon, 27 Jul 2026 16:44:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785195851; x=1785800651; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=bOyY/7st0w/fOk4vhmzD7NcnvHphtli0+U32ViasH6Q=; b=dDRK2NS3M6xliijGlNkiI6DkNovueKbYSEFvfBOSvuBCKwjypvf9ju95Xaz7wM+220 EgGpQJzmfGsmSTpEqyqH5qUhGhvp9YE7ncOcF2wFboTKnOxIwS8zztkW55hsY7hcIhPC rdhNGOhhM6D9flVFgaUpmhxmkoCpALWxMrvSlasVUbJvIfsjtqXE8gDVBmH+6szOI/Xh 31tuY3z3SsHG0zqPHoCLxS4SAYH780RbKydQ8pDPZwJqGvn4Tz162DOapxOoGQvmNiKH jpjWackvBSiIjPJVxLik8H6DAvMgGxQRty+W92NSFEpYCouGQ//W9T7JE7bh8rPHfv6l PMhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785195851; x=1785800651; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=bOyY/7st0w/fOk4vhmzD7NcnvHphtli0+U32ViasH6Q=; b=U4iSTZyc2GbBGFDtWwkYkhf+DxJCMarGoH/RFXE1rDMP5szNisuYGrDuVvYzlI3nis YFl5qWlk76fFELYcIei86rnX/8YXH+xGX0lJ/MfRixwnMylYCiNudC8Nb+IHtJV/tPgs UEOapPt2rNKz5n5rwMivbQ29i4FCIglta4vqBjVGclmZyd5rOSva0F5F+RiozOIf6PZ6 D0dP1wwYBNmTHIGfjEMscuVj2b45d4GXw4mcfmphD8/ThQWIc0gyu/ElZs5RTIN3POev iO1eSvTkGxYFFz2AmNC2XvaRhG1vA9i9OYwtWRvnITPIVZgSo3hHlhjaz+qMx1b7FSsA sClg== X-Forwarded-Encrypted: i=1; AHgh+RpcUldFRd+7y/LRWBc5uPGA7AzQbD7cJGQanMfPIpoz32FGEEgyEYIWiGH1r6LKuYF2f7qzKl6hnyN3fn0=@vger.kernel.org X-Gm-Message-State: AOJu0YwQ+XNuQtSCdvlYKrLkAknASItDEsz8lylq153WxwUMj7Y15TWK YXU2iLkpYE/E7ooZuQKJYJrZilVLbStRTNUn7yRAd9E6E743Z5vWwMad X-Gm-Gg: AR+sD10fFH44GIl5vDnoYtrjVVjB3XGYW0pUWFYtP5hEY2H84aUu+sMDht2J1nST4/3 lDydZEGxAuLslNAIxLc0qNZUzk+vQnv4/FBdzRPztUcDz4Pw5OgsNdXGw6/+tYXyrR8P3E9CYKh Zw/r3RBsArlCgfHvCds9jt8NzFdJPYhf4DzvdLZUdPDevjW0BpfKKvbYbo7Ms+1/1Jh9DiHfgP0 NO1KdTIjzOR3R2/+8+M4xVe/x4IM1EAaVmzCGGj+6R+7gVNqmANagke46uozR/iKUHGGfd0n47+ JzHWRPpekoSYniJTL60hkhTOfxr7QVNvtPX8QiDJuJQHcUuYaHhvrXQotcO8g09Dc59EZ1F5Ro2 oaWzDOEs8iLINv6CXECLzk89XvVZpvFA9Ivato6fd0zD/gc4KW75VlV2jnVPwy2kSc9oxrpWkWE dSJPyHtgEzR8AOWsljeL2dN4DvVs2gljjBwd44X/zfsV0hvTKJfz+7S3rbIufIn6/9g6v1Igve3 bW5roa76P8fgMhm9dD8VGynmZ82oVGBHW3V6w77jhmJ3Cn23UBK41U= X-Received: by 2002:a05:6214:5b0c:b0:8e9:f62b:8f91 with SMTP id 6a1803df08f44-907ec8ec1f3mr123698276d6.55.1785195851166; Mon, 27 Jul 2026 16:44:11 -0700 (PDT) Received: from ryzen.lan ([2601:644:8000:7a86::e34]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-907e854e43csm75945226d6.16.2026.07.27.16.44.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 16:44:10 -0700 (PDT) From: Rosen Penev To: linux-pci@vger.kernel.org Cc: Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , Bjorn Helgaas , Ray Jui , Scott Branden , Broadcom internal kernel review list , 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 Message-ID: <20260727234408.296186-1-rosenp@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 #include #include -#include -#include -#include #include -#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