From patchwork Wed Feb 7 04:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13548112 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 0766EC4828D for ; Wed, 7 Feb 2024 04:39:25 +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:Date:References: In-Reply-To:Subject:From:To:Message-ID:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=S8PqEKpt3o5IKBFONc1Gp/K9gN3t/0Y8S2CSwcrAwCY=; b=2MAYasL1eDBbznXKB0P2wWJpXB 8POGsozW57Vwpapqj26Z1bF65MdR7cDhxZQ9xOmSUzKlNXlac+vl56T2zrGS34arYcqZAt+AmS/A3 QnVcv6L6AYmspjw0hmdQGKGSiOpHpnAo+4qNIL0ZGmQ8tAu/8wM2gSAzgKhRpOuErEnS/0TWfKOfT DFiPPIqCwQcesVBSwBen7BX1/g2ZH1+zSHG1YcJ1eh4KtDQe6zpGyCNJ5PTTOUX3iGaYJwSYnEjSE iDlfdOAxZc0leYOZ9ld4IQYIbrHs/tiT5JYnXdSIMnuu1PSmHLfEJe9h7NUmCOdWd8bXO6tXtHnae teVqkh+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXZiP-00000009fs1-36S7; Wed, 07 Feb 2024 04:39:17 +0000 Received: from mail-os0jpn01on20601.outbound.protection.outlook.com ([2a01:111:f403:201a::601] helo=JPN01-OS0-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rXZiN-00000009fq4-0YNz; Wed, 07 Feb 2024 04:39:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vfq1ARk8Z5+PJRhQZHGVHVvqzy7s13p10G7Ss92+5ONLfujRJxSct+cQ5ykiMUa2GVXf66hCygUIsvdknI3olpi7qKkLe36hkMAmTKT9QOQsFvrTJG0/LJp4pLU5UZsyy55Zg4u0RkbCVW9kUC+Px+wIaFBoT6OA7R0Q6Ro4yT6tgVBtV0cE9gF/ZWLVp6Ed235GE196Zl3fImsTCaAnRTWcbeZMyjmL6KyspT7ffleYQGrRNhSs6INgZc4boObIV3ahZQLu5znkhTb6qLRuy4C9THh6XqyrYMRWnXIK0FRBRf0FsWS+3pXz6lLNi5HPFbgTzClzGpDCX7qdfk/5Mw== 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=YXY+gyUBLqHr5OVGylRo6rD1OZwlsUDCqOi/+/20yMc=; b=lZO4Dz/GNHo1h09jBNGewKP5aTros4FOvOWP26VM/UB6in1fjCX1Ydzt04DcQ1oNOWsaU/fh8FdOLX1Y0fIIFgUKrLs2RKGc/ABHp2JXP2BVYr9A5aD3rSmvqZVGyY3MVjhIUIomDXsaflbsIa9pvwvYf6TEAPk4SmhEvjtCbTkGXQ/0m1jqaI/D14VnUnYM+g5+w83biBTjs6pxzdKS8Aq5WxGOk7tj46pW+KuXEydwUCQv1osw6JiTFOFMzKF8ieFNrrlMNOF0iSuFI4NpI3GJj4bv9vO9Vy2rgedx3omovxCWVNrOl6y1AnzdgYYEf4y149jVYC6153fcYoZUAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YXY+gyUBLqHr5OVGylRo6rD1OZwlsUDCqOi/+/20yMc=; b=l93jM7wTF2zOE8TTd556QYt99eVQ3n2ES+gvDh1vespfIi5OHnjKfOFShMU/jupikKXayEhInajhApocMmnm7UvCk/JKe4TkEmGbVzumvAEGPJ/BfZXpJRnMFPdnHqVPLr4fu/vfCe46zpjwTt6qjcDVSDTV0A013Z4qvKerKQ8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYWPR01MB11031.jpnprd01.prod.outlook.com (2603:1096:400:398::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36; Wed, 7 Feb 2024 04:39:08 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::4d0b:6738:dc2b:51c8]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::4d0b:6738:dc2b:51c8%6]) with mapi id 15.20.7249.035; Wed, 7 Feb 2024 04:39:08 +0000 Message-ID: <87msscsxar.wl-kuninori.morimoto.gx@renesas.com> To: "Lad, Prabhakar" , =?iso-8859-1?q?=22Uwe_Kl?= =?iso-8859-1?q?eine-K=F6nig=22?= , Alain Volmat , Alexandre Belloni , Alexandre Torgue , Alexey Brodkin , Alim Akhtar , Andrzej Hajda , Broadcom internal kernel review list , Claudiu Beznea , Daniel Vetter , Dave Stevenson , David Airlie , Eugen Hristev , Florian Fainelli , Hans Verkuil , Helge Deller , Hugues Fruchet , Jacopo Mondi , Jessica Zhang , Krzysztof Kozlowski , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Coquelin , Maxime Ripard , Neil Armstrong , Nicolas Ferre , Sakari Ailus , Sam Ravnborg , Sylwester Nawrocki , Thomas Zimmermann , Tim Harvey , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-media@vger.kernel.org, linux-omap@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com From: Kuninori Morimoto Subject: [PATCH v2 3/4] media: platform: replace of_graph_get_next_endpoint() In-Reply-To: <87r0hosxc3.wl-kuninori.morimoto.gx@renesas.com> References: <87r0hosxc3.wl-kuninori.morimoto.gx@renesas.com> Date: Wed, 7 Feb 2024 04:39:08 +0000 X-ClientProxiedBy: TYCP301CA0048.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB11031:EE_ X-MS-Office365-Filtering-Correlation-Id: f349be94-96f9-4da1-f038-08dc2796b92e X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n9NwH1vAjm0A7H+A7RaQVlgY7l38Wfr4bBws6+kSnFLF1dfcY+TVzL1BlCfcdbnmBizMmfz3tI7tz3e8t096MqPAk/ET4pfpSLwt12LqmnQq0oBJrBX1Mycmg8USG/9p4sAe5Ro0VwWiA6N48xu5uJIWXSQalED+ylV07tg1D+By44dbmouW2drdIJAbCvVoK042RkA/LyNDTF5mYVxj7NdNh3lWk16EVRikUK2/3Rme7uc6YZ0DFT1tucWD5EgbFsRJMPTVyljjemujlBjo+Mfko59HlYJsnZFSqpzK28er16Ren+7dXT3NaWbGHJBHJKEftqQTejKJ5m2MAeFR6gGCHavmErw7bX+YuTAhlqiBWPZzbVmwLT4nkAfKe0dre43m4HcwNBl8S6qLjNZY3mWARqYPITDCt3PFzbIXYB/c49oqlwJaWwd5SerNJLnw0087Oavmn1bwuRfM7aKFVRKubDPK8Kz7HNFaRO9cg7IGtTjVlN7GVMRvC0yM4LE8dQcxavBH9Qv6fPJAHJKte00i04b10FFquJ3O8lQvhY2d2GWJ9NjMYzKKg2CnAFfcv2OAQv9Jp64K6bb6g0g3JogGyEYT8xLaP7k6Y8C60X75h2/5yFawSfxANIfyF+mN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(396003)(376002)(39860400002)(366004)(346002)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(41300700001)(38100700002)(66556008)(6486002)(66946007)(52116002)(36756003)(66476007)(6512007)(6506007)(966005)(478600001)(8936002)(110136005)(8676002)(38350700005)(316002)(26005)(86362001)(2616005)(83380400001)(7416002)(7406005)(921011)(5660300002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RFE/dNmfzErAHBAAKAC/pFNwX2iCwdoPxYNv/pj8Qk/0/IGqria6sA4BHPCm7bAcY0RErjwbDLWU5K4qPogjPtd4ilgTa2f4TguwZ9/npcrccGMrjIOMtSPFT3wFXfLTncPYpe+DcBS8OktHOQi1/A2zau6ibZRO5bjzyL/tBmfbeU0es9MB2wEaiV7+RIsRFxQRrhb8tUHRnU8nj5vNpY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aegE0XBQkV3e64veSwCPGEH9/ZIORNWOPA25XlEUOFKir2SQtjaPBzGtYvVnUYbdliAdMXluA04OxgvWfmKgrz578y7hZoxTuxOgcs3TDW70f5Kl/GkavH1DXQnqM+I9uzhn9ZNKc5eLudFiTQ+5eR9H1l3fYZBQbX7r18rsP9pr3M9n7kYyL17MV6nEg53akzKm+03y1h1yJ2rcgtgoOcdN6QoaOu/uvDdGOBdeMc3iEzSOQAdgk3sYgE6OJLSxea5K0UxTrrvypLxOU265k5YXSrUxJdw/F2A/mD02ETNQdBDnXJxEdTTEhRpjogzcQpa2BRDU4VNjvAPRdFEFmgAJF5EOR3lXWil4oyO2Wl8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f349be94-96f9-4da1-f038-08dc2796b92e X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 04:39:08.6159 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: q3Rxc9V2OMKCYUyLwFnZrx/DwGM0yCB2sxjpATGniPoQybu0GQe4p9rPfpumYj6rS0YFA/EiYkbQqnwjCOuTLvhKgmQ1syS3FHJh/Jp64FuVU/L019kEDFFSxxTjM4fs X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11031 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240206_203915_203115_FBFD6015 X-CRM114-Status: GOOD ( 14.40 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org Signed-off-by: Kuninori Morimoto --- drivers/media/platform/atmel/atmel-isi.c | 4 ++-- drivers/media/platform/intel/pxa_camera.c | 2 +- drivers/media/platform/samsung/exynos4-is/fimc-is.c | 2 +- drivers/media/platform/samsung/exynos4-is/mipi-csis.c | 3 ++- drivers/media/platform/st/stm32/stm32-dcmi.c | 4 ++-- drivers/media/platform/ti/davinci/vpif.c | 3 +-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c index f8450a8ccda6..c1108df72dd5 100644 --- a/drivers/media/platform/atmel/atmel-isi.c +++ b/drivers/media/platform/atmel/atmel-isi.c @@ -834,7 +834,7 @@ static int atmel_isi_parse_dt(struct atmel_isi *isi, isi->pdata.full_mode = 1; isi->pdata.frate = ISI_CFG1_FRATE_CAPTURE_ALL; - np = of_graph_get_next_endpoint(np, NULL); + np = of_graph_get_endpoint_by_regs(np, 0, -1); if (!np) { dev_err(&pdev->dev, "Could not find the endpoint\n"); return -EINVAL; @@ -1158,7 +1158,7 @@ static int isi_graph_init(struct atmel_isi *isi) struct device_node *ep; int ret; - ep = of_graph_get_next_endpoint(isi->dev->of_node, NULL); + ep = of_graph_get_endpoint_by_regs(isi->dev->of_node, 0, -1); if (!ep) return -EINVAL; diff --git a/drivers/media/platform/intel/pxa_camera.c b/drivers/media/platform/intel/pxa_camera.c index 59b89e421dc2..d904952bf00e 100644 --- a/drivers/media/platform/intel/pxa_camera.c +++ b/drivers/media/platform/intel/pxa_camera.c @@ -2207,7 +2207,7 @@ static int pxa_camera_pdata_from_dt(struct device *dev, pcdev->mclk = mclk_rate; } - np = of_graph_get_next_endpoint(np, NULL); + np = of_graph_get_endpoint_by_regs(np, 0, -1); if (!np) { dev_err(dev, "could not find endpoint\n"); return -EINVAL; diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c index a08c87ef6e2d..39aab667910d 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c @@ -175,7 +175,7 @@ static int fimc_is_parse_sensor_config(struct fimc_is *is, unsigned int index, return -EINVAL; } - ep = of_graph_get_next_endpoint(node, NULL); + ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!ep) return -ENXIO; diff --git a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c index aae8a8b2c0f4..4b9b20ba3504 100644 --- a/drivers/media/platform/samsung/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/samsung/exynos4-is/mipi-csis.c @@ -727,7 +727,8 @@ static int s5pcsis_parse_dt(struct platform_device *pdev, &state->max_num_lanes)) return -EINVAL; - node = of_graph_get_next_endpoint(node, NULL); + /* from port@3 or port@4 */ + node = of_graph_get_endpoint_by_regs(node, -1, -1); if (!node) { dev_err(&pdev->dev, "No port node at %pOF\n", pdev->dev.of_node); diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c index c4610e305546..ff3331af9406 100644 --- a/drivers/media/platform/st/stm32/stm32-dcmi.c +++ b/drivers/media/platform/st/stm32/stm32-dcmi.c @@ -1855,7 +1855,7 @@ static int dcmi_graph_init(struct stm32_dcmi *dcmi) struct device_node *ep; int ret; - ep = of_graph_get_next_endpoint(dcmi->dev->of_node, NULL); + ep = of_graph_get_endpoint_by_regs(dcmi->dev->of_node, 0, -1); if (!ep) { dev_err(dcmi->dev, "Failed to get next endpoint\n"); return -EINVAL; @@ -1907,7 +1907,7 @@ static int dcmi_probe(struct platform_device *pdev) "Could not get reset control\n"); /* Get bus characteristics from devicetree */ - np = of_graph_get_next_endpoint(np, NULL); + np = of_graph_get_endpoint_by_regs(np, 0, -1); if (!np) { dev_err(&pdev->dev, "Could not find the endpoint\n"); return -ENODEV; diff --git a/drivers/media/platform/ti/davinci/vpif.c b/drivers/media/platform/ti/davinci/vpif.c index 63cdfed37bc9..f4e1fa76bf37 100644 --- a/drivers/media/platform/ti/davinci/vpif.c +++ b/drivers/media/platform/ti/davinci/vpif.c @@ -465,8 +465,7 @@ static int vpif_probe(struct platform_device *pdev) * so their devices need to be registered manually here * for their legacy platform_drivers to work. */ - endpoint = of_graph_get_next_endpoint(pdev->dev.of_node, - endpoint); + endpoint = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1); if (!endpoint) return 0; of_node_put(endpoint);