From patchwork Mon Mar 4 05:16:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13580057 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 54965C48BF6 for ; Mon, 4 Mar 2024 05:16:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7ACCE10FC71; Mon, 4 Mar 2024 05:16:30 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="or0Vxr1c"; dkim-atps=neutral Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2072.outbound.protection.outlook.com [40.107.113.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 271A410FC71 for ; Mon, 4 Mar 2024 05:16:29 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NXNC6Ymy9+EccVWrKT7pbpUo2uECKO/4HHmsu+F5hYr6ecKVuigkV6hkU9TTuup+UAxfjrTFeTkTkcm2eqPTKYRKNDslS7Tx9UMecH1dzUbTExXlDF7M0eYhZoqK3gkfhfIjcpQDxPNpD+20Z/UQZqmYoK2v8G08Y2pHybO+lEkB5tmNFUY7TRqYmFESVvMg1ZH+aHWEAzKrgzmhoNUBYOM3iJQo5OROVDa1IcWI/fjCXAEqZaPxjpjbKSiijZeNb855yYMcxFxuzI8r1eUoQvEfvm50C2dUjGbci5tdMVoMFLGbf7jlvSjhT/lgZ29CgXaTzSIHqGuG1bXl4S9YIw== 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=JUYz6fWUaY+A0uGqgclzfvrCEd1fyVLY9UUFx7mCWO+7plAVLK4Xg7iLI9N1k4pMhH1Ker/jZ6Y25ziMOBNf0wWyWPuzUqzHF71UueTQorFiSXn9Ga+csux+UPOVyU3+yPx3b8CyQUyNrVrdsy7jjDu/lKvqVUjNlfrFh1SZsh54xQMFCR/KOwzkmy4AgJmeQFqGfqLNgoBbkC7JcLLSmAaAuV5v+xf591LrlY3tGDldqin6DtDrHpExLRpZRXk+Jej8Jl16mjqwKiS6MTyWDFYUSpNDLuI2Q32d9Bm7prQDbm8oByrwBUrb84pKaZDjtb8yFQaDjiCxIpHdI5c+xA== 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=or0Vxr1cbVd9jasMSzCnvYWaw2rj1Px9v2i8CcXFP/v3KSrashu5lZIA1ZgFln3OVOHN+6flJ74e5n0QsycJ2JO1nuhiaHpMEn1JjKimu/eIwOZ4d9T+2ojdzUTKUPOKHvwBl8pP2c6qqGucmBBLx8pEi8qFqCh06hfyoUHyTTg= 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 OSZPR01MB6616.jpnprd01.prod.outlook.com (2603:1096:604:fe::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Mon, 4 Mar 2024 05:16:27 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::1934:4a38:d599:33a2]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::1934:4a38:d599:33a2%5]) with mapi id 15.20.7339.035; Mon, 4 Mar 2024 05:16:27 +0000 Message-ID: <87le6yh905.wl-kuninori.morimoto.gx@renesas.com> In-Reply-To: <87plwah92n.wl-kuninori.morimoto.gx@renesas.com> References: <87plwah92n.wl-kuninori.morimoto.gx@renesas.com> To: Rob Herring , "Lad Prabhakar" , =?iso-8859-1?q?=22Uwe_Kleine-?= =?iso-8859-1?q?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() Date: Mon, 4 Mar 2024 05:16:26 +0000 X-ClientProxiedBy: TYAPR01CA0042.jpnprd01.prod.outlook.com (2603:1096:404:28::30) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: 578608c2-f880-4dc6-c265-08dc3c0a3e1a 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: o/2aGs2unNCwc3kcdfhOgmzryeK4fysWVvWfOgG3a50ypBWyqX7BqQ6/+CExk6VBzrZ8CH8VwuKTsrT7hM3eDgjdb5hSuUlSAq02Sg1gYO52vGJnRj2/JhNTOj5pbkDaO9jbOeuB3gj5Nr1r/Kx7zwBqb4Wu98P27lPxqtzVqFR0TnINB809GaCNCQoeSmiIh3TTd4LWMBsC3vJ4RRGk/xZA7OptJnqunR+MhiRWXsGAq8+jV8WOI3zZT4jCfhjOtTJotYY13wsn4Jjch3FfUaPF2y52LRxt0ITW5tz7F5yc0/pQCHMhHY4PSMNqa8DT1GH0eAN8ZTVgO9DHOIK35TYf9ZOqTZk1SnHOPvXVRx6g/mLtkwCsvTg1881tFgoRkZF2+J3ewxdPIvFJeGmOdZzUVXqIXRgLEEX30O1pgt5Ivbvby9Z+aByZYSk3mVDDPyLkVin/uMq8/0CIkMYd65yjxnmwfweLwqHmJR++UjaSC7qNfnb00VNrP6aKL/otWJ0vIMfiqnn6peumTE1zCwY4G6Mfdtpu42KY8W845aZE60ewHak9iiiwCHjQEmC7FKH3XeRT01zgE3s+otosb2Ir0HGPvstlkwknm13zf+Y1Zx3KM9JbyMhaqJznk3LR3Tr3pTwAqHLpBtKAbpGpxW8GLvyPAj7lyRKxER16FvgA9NxfOVq722FmXABJMQ79 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)(376005)(921011)(38350700005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A+PcMLEJeq1866ACdnbANXcBqTQQVxTmkWzJ3rh9ibiIj5CPnsfr2Ob61thZgbnFaDEGSIZtG0w9XvJZ6CpwU3RQycD40rUlYhqIXsNRqkxWC4vthpFFmPBaFFDJvqCC7HnatrtdSTRbfrxYB3atwfIH6XT1/x4Ik2rA6jTRqJBKBUewOWnNyZEXWGWv/gQiehDYuGjFGK2C+hX/XEHwL1vfiQHWVKbLnCFitTP9YEIt1Nhcp2jrqPnDHGBKDXDdfZgEPqQOtYftu9zawmMKTzXwEAlTCZPA5NE59WgD82bFBJPU5nm6LxPY4bzSasRLBb7b4jVNHLsStRKk/j0Dijn4nJ4yFEGMxoOHs0i1u5a5glYg8CSl5qIQe4glY9WATriIPAxXeFQfSMyMhoH+WbrBFpjTtg7tWo1P+9cKPiHN87ouXe59PmMO8EeXZYosHYu4zVG+/CYb2SIlzkWXuaLYEmo6QycDudOZEtkrzsky+dLjJaOJt5Segprf4KPJVu9whmMgljwd5VS5qDLe6ceOsjksHLwzF6/lwoD/ctrK9B4ibciQ+7vacq6aqhchWLgGTS5L3/jQ1yAMkhFmiuSTGLXyoFrjUPVI6DtcR3sls/KTa9i8ZTt4ObhgnJFrjI1XCUQSSMjHv4aSliw6Pm9iS02MHNLojKDBIbSghWeHw+RKSVo0/KapJfJ3uslIQdKKTd0tXh/+sfeCvu8YoorWEYdXEBxwyJnvAZ/3uVzQVtF4R8P2CMYXj2OYO4WQbZJsGOJGBHs6SOq3UVgM43igvVlDMhhy5LgtFjWQruy4+Ej882AmrazVUD7PXx9VnOvLSa/5jpeqV+CTUFhv0XV+1Ir0j4jBO59eE/KgJWm60bA2oG+0c/y/zYTvFcHVwqAEY54tV9+UpkLIRbF9q9W8L5Mc5xkqREaAS8YKFzCl0ZWTERi2ofv4FwwXs8k5Mt566y8gqRm/WkgHbRQrbJAPTr8OeTKsuzkEbaKwKsXFsjWNKV4+dGZQBCcfJX5lw7KkJjiFGE821wmpZvSKqmzT7Iet6Aug3E+30FiW9bptf8mv3H4eQ1J/rgIMs3I3QuKgiIW9b9IZLSnB89URiYRQb461qWYcjB4D79gLGNHC1ToKvG0F9yRk4RrRGpU8465vA8lie3ADs3X8tTuLgRxXoQNeIPZs7OVQOLGTeVH6d3g6DyWzuTkT9Cwh/xV/dwuIFpQBybr5CES8oWmxK/PLs2I4Hc4SM92/NlfWUGhrDvhjJnK6EX7IsGkeIUNrFwk3wZPdQ5bl480RjSYZlue1sJERxcREFQuk6ImoeJoVuHUV3qQWlk8nqM9z+P+Y5pQrjv7ci8E3sl/8zJcTfkNb4DIPEYBfE7Nl5z6YRXzCZLFHbDLMw7Mb8pqEDHSm129mIb7/wtYlng7W83k4/6A9meaT9WOaVY47RQ/WwDpPzJkabtbDGuvFyV4ts2+R/Hb/cZzUCreRWxdt5hI5PfIuMSFbHRSC5QCBSAbUrVbbPAu5+MriS8qnzdO9LGZG4Y7+pWbTerGVeo4W3TT54pNMGJw5dhiUCB4kjAuMJOeaJ/JjntWtES2Xw2E13zq8I8PN7Ep/3sivo5Xp0n1Wl/6xQ8160iMwoLwgoziC+g0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 578608c2-f880-4dc6-c265-08dc3c0a3e1a X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2024 05:16:27.0195 (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: AhSSEKTnx/dgyVDNFjDJWpSbLmGk28UrA6ogWsI4dE2rx3Cg9JTojAEGG5kyDga/r0NFCwykNKOEmnjKFXykJ44zJQ/t4cJoGROvUuhVRC0Wig0g+d2+N3nhyjjQLEq2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6616 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);