From patchwork Sun Dec 17 05:12:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13495754 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2047.outbound.protection.outlook.com [40.107.7.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54528101F0; Sun, 17 Dec 2023 05:13:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Ojdznu8P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BxkOq7GVpxbbAWhDl0i/Q1bdK7vY5pnM/AzKLriypux/aOMFcGcVFAK5wru/+QYeaWeMoDFQ6sFElc8SiNnVX88tnVA/LXqAedXlc3LYRus/bnrWp46gHU7DjhFs5ZzYTs16MyE8kosOE4ivr6rVMh0Kh2ajQfDE19wWamVDuxU7BqBf6zx3exxvlv/KDMMxOxdbyMpMlviXI2yYW+l55nVfr+OrZNEzqsP2ICII6pR8pr0TjIv8wJdvt5QSCE1Ge5WnA7+7mSkMmDXF9sHQcfpEK7AZWyj930c3o60mRflQtAJaEKVHK96rdcFu45gyGk+Z8GK4VN1rNAvUVIoL+Q== 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=huxzAgtOfR8eufcHlwd/FrJVMvnlcg7jp5zNfrc5qrM=; b=JjgvEn3BWdZKn7yLh5b6hJgRi1slA6f1JHR27q6RtaynVddUMWnFgDiWP6BUoSaB9YDbvvqzgeaY0+lbjHnd3MDJ3yrJn/Zw9OJVrj09IzpYUEwOjptWWp2rPFv1FXAsM2n0J+xGXLoGSaeozml16+FHSHLapLUTlwKTvLZxQRXZlYvNd3cECRSCBgQFlsqG2N7umebdcl45Bhqt/AGifyAPja6kl69UsT3GE8i2zy01uFsLC9p9UpCJXsTb8+shtvIxT+DxmfVbSaWUgH3vK3YlEN/v3ZxoZKeSqid3lpTRLtNsMZv+tti6Jbstyz74wZuHBgQK7Bj9tMb3lTwvXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=huxzAgtOfR8eufcHlwd/FrJVMvnlcg7jp5zNfrc5qrM=; b=Ojdznu8PRfK/bk0MaoB2KFVlg67giuQ8P3N56RNmnOSkNdFtyiB4Pivkks7EDmnsmiXUvALo7mo0Te1ojAYomaiJ3JIu4qeb6GCxYxabgabuNkCcqLr/Vap5ey7j1qZxpFKzP19r/g58Z/B+P4q0LtwZf5yyoBsmu2XcqJYXylE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by PAXPR04MB8174.eurprd04.prod.outlook.com (2603:10a6:102:1c4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.36; Sun, 17 Dec 2023 05:13:36 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7091.034; Sun, 17 Dec 2023 05:13:36 +0000 From: Frank Li To: krzysztof.kozlowski@linaro.org Cc: Frank.li@nxp.com, bhelgaas@google.com, conor+dt@kernel.org, devicetree@vger.kernel.org, festevam@gmail.com, helgaas@kernel.org, hongxing.zhu@nxp.com, imx@lists.linux.dev, kernel@pengutronix.de, krzysztof.kozlowski+dt@linaro.org, kw@linux.com, l.stach@pengutronix.de, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lpieralisi@kernel.org, manivannan.sadhasivam@linaro.org, robh@kernel.org, s.hauer@pengutronix.de, shawnguo@kernel.org Subject: [PATCH v4 12/15] PCI: imx6: Clean up get addr_space code Date: Sun, 17 Dec 2023 00:12:07 -0500 Message-Id: <20231217051210.754832-13-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231217051210.754832-1-Frank.Li@nxp.com> References: <20231217051210.754832-1-Frank.Li@nxp.com> X-ClientProxiedBy: BYAPR04CA0007.namprd04.prod.outlook.com (2603:10b6:a03:40::20) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|PAXPR04MB8174:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e91e04a-d210-4959-9ced-08dbfebeec18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y2YDxLxjUMExj7DJPqfI2Fw0RmxNXHCDsf1wKoHYCr2S7uCUTkSgn/Hg5nkfvHaG7Prk5gq13Z4HV3rRK5Z5J8x5fU2WWQPfzkprbdTjvqZDzsuKypUkFtX0MgdfatJFQcmY3cY4wvQz3VBOQ76MP9gqEtTACJL/lgjhb2aT5Ij0idkPN25HGYuPaWKPV+BtooOZLmBCROvR8nP/RNL/BGCpzlC5kwDTKyvoacZb6QFd9qkC4Um0m54aPZ2rEMWX5VZzaWON1abcfDnRGEiJAX3eFOktKZZT2QdhtSrlOlJS490PnozQ+jfRkrkD1fmEWwzTT9rv7fHsBhgmyToLdEp7xHLw6k7hF/GJD35+dJeETHAn498+StAZ3aeaPldCYrpzvuK/A7ZqxULdH9PBc8KbYtNOHC8VulFcLVhwWKwCDcujjwe4dkjACuhCYGh6GFMVStuOgGSZDmRBk5LJTXQ4phW1uqrX/DM/+AK4kUKPJuKwnkvedVBsJaM8Qjc0TIo/TpYrfz3vA9pISSLB9arvxq7/bjo8uovqFUFYSK2U9PhvICfZkfMcSDIRaPZbwVocD4NOwUETmXsHJUnxyfI9MhYFf77ebS/B3oVJ8iLXFF6N1uZ3oPZSNuRX7jHJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(136003)(396003)(39860400002)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(38350700005)(86362001)(36756003)(38100700002)(83380400001)(26005)(52116002)(2616005)(1076003)(478600001)(6486002)(2906002)(66476007)(66556008)(6916009)(6666004)(6512007)(6506007)(4326008)(8936002)(8676002)(66946007)(316002)(41300700001)(7416002)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IJ3j7R+LR6ONaqVlybREoKWZAnkIzGsQT8Wcn+Fwuh5uuCfVnIEyD/W7ThRxZzxKSDQJ0mc2YIqSTZyD7JRyQHfCV7HSHIZBl4kRNtRyHd6c2F8fPNFIJbGPAA+ZXo0rTC3cuQ4jxj9KiIogufGnt6Vqa04S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Pfm1L/5dgFGkAsjtizgXuQ0N0WLcKRMA62WjvB/60i4px56B1x5cMP4qvYE5WhMFtDr9u3HdW9yzM34goPxW7nRlTZOe/0KHz62Tkzw90rmQSipKF22ltJ8+a+HkI2NJXj+OwQXIC65Sq/RtRV5+rwYBwGZLS+lRMLYVJsMlEV2gH0QSJxCn4IhOdslelctB5PLiYrnYoQI3DEz1Pn0wBnBtpjLm0BXZSwogD2+lkRbh2Muuuuh65vP8IKllVvm/oSRmuIczeK1w/xOQ0NpsUsLZN2bWA1Kxdax4++Z192eTAAh/sn+/q6M3UVcaQc6CCkDZgqvddL9h3C6c= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e91e04a-d210-4959-9ced-08dbfebeec18 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2023 05:13:36.4830 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wKsIdPfVxVdKMfq0RAGXISRzTrUYnqOA2rG4UiHjd6t4jCI5Mmp72kQMmDZJ7CUt6/v9R+dQUbxcc1uOdpDv6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8174 The common dw_pcie_ep_init() already do the same thing. Needn't platform driver do it again. Signed-off-by: Frank Li --- Notes: Change from v1 to v3 - new patches drivers/pci/controller/dwc/pci-imx6.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 324c62cecfa5f..54b90f8576915 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1080,7 +1080,6 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, int ret; unsigned int pcie_dbi2_offset; struct dw_pcie_ep *ep; - struct resource *res; struct dw_pcie *pci = imx6_pcie->pci; struct dw_pcie_rp *pp = &pci->pp; struct device *dev = pci->dev; @@ -1099,14 +1098,8 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, pcie_dbi2_offset = SZ_4K; break; } - pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "addr_space"); - if (!res) - return -EINVAL; - ep->phys_base = res->start; - ep->addr_size = resource_size(res); - ep->page_size = SZ_64K; + pci->dbi_base2 = pci->dbi_base + pcie_dbi2_offset; ret = dw_pcie_ep_init(ep); if (ret) {