From patchwork Thu Mar 28 09:18:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 13608390 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC311C54E67 for ; Thu, 28 Mar 2024 10:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yNIB1ThaSInxtHDujaZ2F+moRlexDp9BAqMjKM3xqpI=; b=uN7mKkMY2iGO5g xVCvlm9QzP6dRqiYbBnVpydafNjiJaTYxZQYLO/3A6fAAGb6mX6wG2J2TpDXdQTN/18FeM5o+xGap Y7a0ozrHPBnBw5inVCdIQn/EVCyAooy1KWhn/2woxqRCsTZiiRtJcMnphi/DNGNbpmjGm1T3EkOPD pmhqqYhYPvJYjlBH4zbjEyUtso0oUoAvAHpZbH9BFaAKXsNcowvnwMIsqLSBD/NbU7tyVYTQxgZlE 3DwiW4ZfO18DN48x8MmNH14doAhkYIdbkw46ekaCGLIyOOlUNgytaOl1eUxoXSy5G//rdrewNPkP2 f8a8Gayc7qnO8+zaJ96w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpn4j-0000000DaSh-2qRN; Thu, 28 Mar 2024 10:33:37 +0000 Received: from mail-sh0chn02on20725.outbound.protection.partner.outlook.cn ([2406:e500:4420:2::725] helo=CHN02-SH0-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rplua-0000000DHIB-0rxb for linux-riscv@lists.infradead.org; Thu, 28 Mar 2024 09:19:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HydTu+bZdUz3Uu3F6OztMJ0h2TCNBYujhlJV/0YXKqrd1fG2ZzZ+gfnQA7XFcXTO6iBmhjLu7Mgbevv7Qoxk0iPRgNEaVmrDsiSty6l2lC29J3pW0WW4Ax6RdAl/eJN81SVsnaaBciPUQJfWpzhzFw0IAyeFiG9dQpFDdb3A/4EkqAlOKz/JZZsTAeQAcR6FsoV4iQ6C6hd2BR5xqrHwL59pTBatJJnWcpkmiPUhHybpbQm91Cjrz58xX66TQXY+5PML3XmDumSjPlxi2OJOvAZN+sRv444glywb40ifVqdgZip4p2NUtfKYKWcP1eO39SlwSfiABzNAAq34e04h7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=H1L2zCinMaKZ61leC9g0xpthGdFxAFSQ7l+a9Zn1/VQ=; b=CraZKrZ0Mk9gA4YzBLdL1FGRLxiUJxmf8qq/5X/3XO8l5K36/H19k2Mf6WLzig/WB3iMTTjgUR+hoNKzwQ2lZvQ/BPBwKQObLSKxyqL0pFI3rUSntSWELha4h1QrA1fD5tgjGmB97sRSmXDHEHAPjIAmIr431IuNSpo9zoy7HaOp9w3DqKK/9GcgwAK5WtYV917eZRCqngw67Wmau7MqvGKBYHCsgwsosZviMs5niTrOP7wshW7uLDmjYE4ODjReI3X+mqQ6SdVknnQOc1iMTsChFUv52UYGy+wmo5Rv9Vr+f52jlNHsF33pWpmnKoIhQfk4v6n/lT1cVJlMzKmtQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) by SHXPR01MB0526.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Thu, 28 Mar 2024 09:18:52 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::c738:9e6b:f92e:8bb9]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::c738:9e6b:f92e:8bb9%6]) with mapi id 15.20.7409.031; Thu, 28 Mar 2024 09:18:51 +0000 From: Minda Chen To: Lorenzo Pieralisi , Conor Dooley , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Thomas Gleixner , Daire McNamara , Emil Renner Berthing , Krzysztof Kozlowski Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-pci@vger.kernel.org, Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v16 08/22] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Thu, 28 Mar 2024 17:18:21 +0800 Message-Id: <20240328091835.14797-9-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240328091835.14797-1-minda.chen@starfivetech.com> References: <20240328091835.14797-1-minda.chen@starfivetech.com> X-ClientProxiedBy: NT0PR01CA0020.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:c::16) To SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:25::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SHXPR01MB0863:EE_|SHXPR01MB0526:EE_ X-MS-Office365-Filtering-Correlation-Id: a799fe66-961b-4faf-0bdc-08dc4f081574 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bwPtdAsNgZ1sN9vUeHuO+tHvoenBQkLfKt3HlKaBVsfC9tuonXwvgvsWHePz+GVEPRAL/cDJZDrkxd4bcmpWOVaYyKxufl8iwJTBCVTWShzQMOe6dYqw79SNSwJEDvVTDWZEFBLnvFexXmuBXQrf5FK2esREKh+deaBRZl4jCER/CP3bX/DgEbdRsRulybD9V4VXJRsfBWWwHi4hR1jVbEPj7rwPsgwWcB+iRJY/31hBb4nJL5J/P3pqeCqeo6hRL5PziRqVs6ci2AkF/7AKuYlIWVxNfTjrr9hlWJ+5YZu329hlba0BbQNsDJtkdRZqIsQfl5BtgCEuClznnALDkI/WjTwtwpZ0qmaT6P/i2aO+8Vdxu5DYknVMwnLoM5gHWy6FWRsNEKpEhsGM8EXN9hu5WtNa6GGGe27DJYadfjKXa6nkyl8pipdF/IcFn8HnNQqnsIo10ILoJcWLnxM/HWc9QHz5YANrqgJG+gEMdAyVaPI6BzWx10xUGgNzGtNieA4n/slbYqBMUZsOj94fTV4UNq3q79diUbtgf/lj/CoE+cjdXuxx521uxaOsZsQx3F8b6diDdZpciyz3zMYXOZpc6YBMIoGe/olMbG0x7k4rKpLVE7eAr1iqdd8QQHqM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(41320700004)(7416005)(366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CFFPLpq/6mkjG3OzKTxeAeKHBhn/3S1b/YBGid2s1dYZ8cgotLHk3iVeNu0NnVn/AANXdK8XETMMgeqnBOT0klUVS2Nq85/IsNKyPNVKtv9yCyKstIcCjaC5GWjnj381kuXOghQEEJlta092/pIGnDu+usP3fZtk+xaaxzDvGRge92myZYfgUIGiC01qJXlqWzZZIgvfLM9lniHBOFx1C7CXiO6N4MPLoJDKLRiZwv58yUGULdIE5DzJOQFmf6+dy75DdC8NTNyQhfLi9xde4aCa0YACnysHgu2C2h/QnmT/VYAued9bz1SXu2DTq/iG8TvJiFAHDJiH3mVpaVRaf8fEk8erlBpSacvT4GTx8+oPf5xGlyv/ZBk0UFxbTrXYRUa8u8WnM/fQ76U/BaxwHOqiPeC3zNnIU3TKEr1myHGru3XnVX2AjkECg+s6TtqW1Ly5s1UUA99tzHgi28RS6Pjw2Ic9On2qXIX0u0xXiOYdzqiwE4HbJ39V2dwL3PqkNUrpLl/4m6zkvgO62mOLu8Unoo10pJ7WqcIYP4Io8I7eG0SzUBqEwZmFZGX5KEtpgDibNf8D77rolYXi824OcOjVl3ov43Wv+QRFPdaIEsotf0OqYrwDoPkf2mKACbDroPg== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: a799fe66-961b-4faf-0bdc-08dc4f081574 X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 09:18:51.8929 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KAE3gcVPpFEC36fq/pLvgu54l+aoAyq0rdJhOiW0MdAuvI5iNlrTURRgs76pg7Umu5Ixrh1PW5xOoyKFreUW9N1xd3gqWdtsaaaB8UHH+8U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0526 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240328_021904_271893_32CD907B X-CRM114-Status: GOOD ( 11.76 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org If other vendor do not select PCI_HOST_COMMON, the driver data is not struct pci_host_bridge. Move calling platform_get_drvdata() to mc_platform_init(). Signed-off-by: Minda Chen Reviewed-by: Conor Dooley --- drivers/pci/controller/plda/pcie-microchip-host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 9b367927cd32..805870aed61d 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -876,11 +876,10 @@ static void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index, writel(0, bridge_base_addr + ATR0_PCIE_WIN0_SRC_ADDR); } -static int plda_pcie_setup_iomems(struct platform_device *pdev, +static int plda_pcie_setup_iomems(struct pci_host_bridge *bridge, struct plda_pcie_rp *port) { void __iomem *bridge_base_addr = port->bridge_addr; - struct pci_host_bridge *bridge = platform_get_drvdata(pdev); struct resource_entry *entry; u64 pci_addr; u32 index = 1; @@ -1018,6 +1017,7 @@ static int mc_platform_init(struct pci_config_window *cfg) { struct device *dev = cfg->parent; struct platform_device *pdev = to_platform_device(dev); + struct pci_host_bridge *bridge = platform_get_drvdata(pdev); void __iomem *bridge_base_addr = port->axi_base_addr + MC_PCIE_BRIDGE_ADDR; int ret; @@ -1031,7 +1031,7 @@ static int mc_platform_init(struct pci_config_window *cfg) mc_pcie_enable_msi(port, cfg->win); /* Configure non-config space outbound ranges */ - ret = plda_pcie_setup_iomems(pdev, &port->plda); + ret = plda_pcie_setup_iomems(bridge, &port->plda); if (ret) return ret;