From patchwork Sun Feb 18 10:17:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 13561781 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 918ACC48BF6 for ; Sun, 18 Feb 2024 10:18:09 +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=jL4UJ8sK2dExrl 4s9vmQSYg3K6PDrW8KGrGcmp1WP/81t+g2m2oIBiCyPeZ58nYONbBGh7b3IGCz/fohhgzDymtf/pd Eb/tZRmXQ/6XZCARCO42ItTRnw9QSQvvKnwfTSxP7OZB7/xdOTob12ABFQjKPS1hWwtOcG4ROMnt3 hbpWC5/Hkkzai6MGXri+038+voRhfnXJQvvJ3lZHRB29g26EHlYkDISrLhj4i1si54x+UTtMcAUfn nTdN1y5a2BzkbZ8Xp8M2Kn7fViQMQsj9vDtmLKga6ISSIIutVauY8iIBXVJR+Zi68MWJJgv/NXtTp hNSm008ZM0gReMvYYeHQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbeFK-00000007TJG-14pg; Sun, 18 Feb 2024 10:18:06 +0000 Received: from mail-bjschn02on20715.outbound.protection.partner.outlook.cn ([2406:e500:4440:2::715] helo=CHN02-BJS-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbeFB-00000007TB0-1gt7 for linux-riscv@lists.infradead.org; Sun, 18 Feb 2024 10:17:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lef6Y5A8qhzuIDEy5oD0azuDI7yoHDt4ZTtdKaW7ORp4BWkKLAAJZHXglII2ZuGctLTRU1rLeQxZPA0HVjQG5YWi17naJUm4BSBKewz+6CIizE3N4Zb7lHAraWv7bvy5Y+eJfaIOaWCkBBcIZNlDItXWNwsUb29J3D0mZYUhMQ3glycdpSozybPKVCOl/qSERLkuV+nNKJlP0T05bSBKVoYVG6SUIPjRF94J5WN6orBKNh7kY2szCK9UWOp6/ygXCfK2M+6y1MhZ1nH7+k8obamux4yUpbW5O0r+YExwbv2Bpf+Ai3yxgJ2fOQ05WR/HrTUoq5+uIjLTk64tgzFeFg== 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=b74mEowkO76tc8nCPTObdhx23tQyPOKPS15iaGEMKchDFYeLERUOELgcERgl0Ygyv8L50SqeW8iusn6iPZt9hAUaxRAxJKwDTT4DLTT8kEoEoLPIj+rOFoB78Pt9xvBbkJBHBDmh7OpkH58efFLarK1kWKOsHPQQKOBQjUZlGwcJzp7WPZjmBa7tXLokHn/4kk+QFnhMwjunSGrzy2E3DvewCO4oM2InalqKQTscGUUMXXD+lk6pPIpRPLWBsfaIn9Jay0Xn0s5nFJaiwsf8w8mud6wPJWrLKseBGosnV6ifwtVSc4lHct4Vh0zbDZ5CIhgQFFxPLq4zb2vbzEYbQQ== 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 SHXPR01MB0765.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:26::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.46; Sun, 18 Feb 2024 10:17:43 +0000 Received: from SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::5a5a:fa59:15fd:63dc]) by SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn ([fe80::5a5a:fa59:15fd:63dc%3]) with mapi id 15.20.7249.051; Sun, 18 Feb 2024 10:17:43 +0000 From: Minda Chen To: Conor Dooley , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , 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 v15 08/23] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Sun, 18 Feb 2024 18:17:27 +0800 Message-Id: <20240218101732.113397-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240218101732.113397-1-minda.chen@starfivetech.com> References: <20240218101732.113397-1-minda.chen@starfivetech.com> X-ClientProxiedBy: SHXPR01CA0022.CHNPR01.prod.partner.outlook.cn (2406:e500:c311:1b::31) 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_|SHXPR01MB0765:EE_ X-MS-Office365-Filtering-Correlation-Id: 769b00fe-aecc-4c22-8946-08dc306ad88a X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 83w/HIPo14ADlXVI+osf47iYMxotXMzk260C7IqG1EwQ2cx7hKx4Bg+OpzGfHOzywmqFSSSpOR0tcIMNrZpMl4Jukfgqgb8iYh2UXrjhvynTC9JDb9Jv29MvjFQcpQW8XI/+SQfcnY4Lu+yOzTfeH/hKxrqTxzfvw8lf33eqN/x+GpThyIRIA0T4tC10iIvMk2TWXo4Z1YVzFYUoRIa+Xw6STNhPQMnnG7HHSEaXsIcitkvbRwq2NaO++4bMEzXnyz+mQp8I732i1+n4ZtciOtl+KOIck+jKq6ppoWFhYpOvnquNMhOBsDFbfSd6WpR0xaGC443dCgGuEdQQyh4dFT/vvu80uQtmw+X5rXt+Po5k0tL2GQS7l1G/AtaeT2u/STbYacNCcCBTAanejkXQZYxspcoOb5uR6rTR5NOF1WLl/fSrDxBf9/Qks+lZ2g79370h5m/mC5UHcDMIdVtIW8VBRW9+D2taqapd70IAtw9FzaN1I8D26142k3nJbJ54S9rtVL/6qkfIlg86XdzFcSZO1Z3HXasJRgC6SRIG8r2fBoEM5xouxkfZJFHs7Q6y 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)(366004)(136003)(396003)(346002)(39830400003)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(2906002)(5660300002)(7416002)(44832011)(41320700001)(26005)(1076003)(6666004)(8936002)(66556008)(66476007)(4326008)(66946007)(107886003)(41300700001)(2616005)(83380400001)(8676002)(40180700001)(38350700005)(52116002)(508600001)(110136005)(54906003)(38100700002)(86362001)(36756003)(40160700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EZ5QsstCIdvt3KqpF/4aK67XvwI/xDQTVggNQieJDza42rm2ONjP6e3KCU+WehYAUAfrZ7mMPim4wMuYrLHN7f1jxlKUm4H3fZXzOU09GyZzBy6jRY6FP3sC8C7NxhU6YoGAHQMr2ifU2MQhQba+q3o4EECm2A1m+Ibe4Mc58cwhZffJfyCp5UqvZDOnSLvGSl1UuSkAZ09NpqvuICOHhHomyJWRekKKT7i6ic+r51tNe1/c2UY5Vjh3yCuf/wgnxbbV8/yRswkPWJXg6o9qgfJ8mplkIJY/3yYJNUmW7f23pFeIVgZaD8p4nYBN3eYRc8OL1xCmpwin4YEbuyuAPPqvedjYMs17i7MYSz7wIwLPkj2kM1LEU+Z3UP0WMVGpnkjLrcPh7oraj5Hf7/QoH8ni0fBYK/fzGNNrrgibANqA4ocoKp/O45LxxMrt/FUgkSJ6a8ehfEq1Gi4X/ayJEJhB16K5utcR2zcffWciEAxbhXPewARqmGQcEPdqTWPhz74HpNTiejjiU7Ymvo7oawzGvcFCirzbc1rstsxcqa2YmNr/44z4mVV1b1DDDMrctgw0rluGEtqROpb6gBhEG5EfUpFXiVkam8klXAi2ywZy/BXh/t7hJ+WpAWP7EbcrKPedEEUugRPG0z8BBgIeo5xNDuRUkdcNIvPAuch03rxPMsOLW7rCiicIScC0MQ+52vPPGsXggZILZu/tQiMZ+Vwmil7UfRuod855jOe52LNlEnOejUVIc783dpZUjH9yyWXUed0ER/+ulFWfpSKpQPwgaBQyD6DJvPj7mRIBXuVB94/6o4rQHKIWzaFVpEydclbSjcOhYzyCJu1FAmpupXxJYeRYTd8lIJGuWCcgry1ss/mL7/54O9vnpR13vTHui/Xtj/bp8ODh++eHXxy1gsmLyyXZSncRrG7kXx+pEy95R4TWWnQNd4XVuKtrxtxfpNmgYytBi+1uQ5h7fivqpRguAk9Sssk+0gv6Gyvly/36EHo/F0Fe+MgThKZQHggxU6YRG+Dq/b+vfxpf/FbYJHSR1dYpJ9RgjU27RHo/e+VO2JRgdc08CD/IlHqCKhc8uFncs6G8vBy2ZeSuUlTq/HWF15SRsy8Vn1OyCFlXRexYuupczsUOepCKK1iRZKnpQOnsU0YdaRtQwnZEH7Q1BrLBsD9MsWVIYpNBixIQqxMjCKt2SrWyC6m+sHK0a1KjENrA9s8d9Z4lMifb5d89mAo4v5SpOaNzQSsj/cg0QdbuPJ6jNOqx3RKHE3HEnyRx9RUM2wFr7k7dV7LitrFXevmm3Fk32tnAYAIfkW9nEctSl1XramOF9KzoWu6VhLPtugdkJGkXsXr1ZdXe/TDvaz1xinBwa3SqOzzjrzeC0df4JuhMuKZhdVCEUpjXkjTYfkcjwE1ttORwsVey4lqq7lfD8S6T/ZyHaJZY+KLyULt2vGIG4e+pmt3zshNYQBpiOy5ypHZ9xAPgKR3T5GyswGnJtyEtcppsmoNxQXK99u1DaR8nLaog6bDr5uenOJu99OwtGgfeyMMUkczN4BjbrtQMvE1JHRhYyPuhMCtxP6KrTQNvuGdSjy2HHuGdUBFFMwATE8eVVqLoH7HRmDMu9A== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 769b00fe-aecc-4c22-8946-08dc306ad88a X-MS-Exchange-CrossTenant-AuthSource: SHXPR01MB0863.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Feb 2024 10:17:43.8234 (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: eocS6y9iW/cmXfIQGZBZHjNMxUw7o7Mn5UqeKw+uAtfFpoMVzTjatoF0p84VR+vQr9lo5YIJAkZK9vgxCsRYXPuGwEKU5AJJXIj2Kj/enFQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SHXPR01MB0765 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240218_021757_562794_9C73CFF9 X-CRM114-Status: GOOD ( 10.88 ) 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;