From patchwork Mon Sep 9 04:38:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13795808 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 4689DCE7AB0 for ; Mon, 9 Sep 2024 04:38:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 89C0F10E116; Mon, 9 Sep 2024 04:38:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=renesas.com header.i=@renesas.com header.b="Ld9ivI4Z"; dkim-atps=neutral Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010017.outbound.protection.outlook.com [52.101.228.17]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A16010E116 for ; Mon, 9 Sep 2024 04:38:53 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TZztDk3jfGU9TG/sxNzk9mPDq2426rAXEYg7NjIuYurvYTtJhpJlsDBgq1LjamQIFy9sFZcHASKQy6+s5vtOTqwVkmlUHmvtHQRni6VyXI3XfGCbOIPqzOZmogQkYCqpSCVMdMYQ7k22IOv+O0DpycAceKaeTj0F50WA4B+opKERrqhFu1cXJH/ed1Py+BGR20bzC9+C+WDEdIJRTtqetZHxJsv55rrS3lzbqMrCZ75GMqRCW1sWs7TWKeT4vlIOwsBjwrG/Nx4dnaes80V4qhQDcygXQtB3NI4QLf5QIrUTKz5qtT46UnJooiaUEi2PwgUUwcIFoxSyTlEA0A71nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=255bn+sOcKplFMg38OQrCo8y7INlB2ArovJ85fi3fH0=; b=LGKNZn81L0BNDwZ7Rc0OM9hDuUmBl1Bo5ZKPdUH7OUdRi1y2iAdZ/hVE1fX/mFo7wXQ2z9Xzzs6VeqV5PKlhEAemw+35fL7Biiy0ljmwtkUsgxTfSrkANco1JE0PS5XotIVT/pOW4AAg+CEkxcac06MKFIaFSe2kLk/7pHG/M1NpLju7/NglTecmV20XSZSpLcOUVtIcx0nWO79lJI8HSeyOK+wvusL3FwodJRYgHeHySMyQxO9krxQhc0Bm9HSKh9ThN46eJN3gZix03VslQAMyKediVY+040zqZfnprpP+t+zKurKSk+gXoNwRxbW4CBOlo/LjTS3/Iqkjmgs3eA== 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=255bn+sOcKplFMg38OQrCo8y7INlB2ArovJ85fi3fH0=; b=Ld9ivI4ZsvKXNe05SIr819qHxTPBKXTmH0FgqBjNslEuKSYBim8JyvT9Xuzbsq7Cu1JQBBlF5v1QYkZYNuKNE5H21z7nQh0dbbcVo/1sg9ufihCnGdg/GqO7BoZeU/fGL21OwrYIkt+FHqV7+iXcnBqqawbW2tRMdZ0j492EMw8= 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 TYWPR01MB11267.jpnprd01.prod.outlook.com (2603:1096:400:3f2::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.23; Mon, 9 Sep 2024 04:38:49 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7939.017; Mon, 9 Sep 2024 04:38:49 +0000 Message-ID: <87bk0xsap3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto To: Rob Herring , Thomas Zimmermann , Laurent Pinchart , Thierry Reding , Simona Vetter , Neil Armstrong , Maxime Ripard , Maarten Lankhorst , Jessica Zhang , Florian Fainelli , David Airlie , Daniel Vetter , Alexey Brodkin , dri-devel@lists.freedesktop.org Subject: [PATCH v3 resend] gpu: drm: replace of_graph_get_next_endpoint() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 Date: Mon, 9 Sep 2024 04:38:48 +0000 X-ClientProxiedBy: TYCP286CA0183.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:382::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB11267:EE_ X-MS-Office365-Filtering-Correlation-Id: f4f7261b-4077-48a3-cf93-08dcd0894c22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|7416014|376014|52116014|921020|38350700014; X-Microsoft-Antispam-Message-Info: 92dn0K55hIRGT0/U9HPfwFW6vFq2lwCJrLlTZGLNHbKYxstDLWZRqXsfYdcg99lsTjODH//xLKID/tWLVKhmASj2m7eU0WfMojWZT88mqZl/yNiaFFqF+EFTI1ofHWDMaZ9yb+nKGdxt+ZiL3N0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iynSMQNIBR/36Nd4ZcNA5Od3CzCcrVUDNxYGyOEQZaHjsJbsKGNhvujT2hLIx/pvDCgdhDcqrHnobyh1XHNcerAY4BBNO5pQXOBSXDP+ag5KSLOwNxhdFJhH59xp86qU9gRvfgk9pZ6HQRlNfQunHal/tGKxyfRSEe+xqRQ600PmY1iM0YMp9z2/eX5AGqWVe8H0LipmcF2tCOexcmqFqF0UQ= 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:(13230040)(1800799024)(366016)(7416014)(376014)(52116014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: liSiHyyF1cibUJqgCOYvMmboZzjMExNEZc596JD/uuXErO/vveRnMot1tRWPvlK+KQEl3jTwfShVGZhmYXbjvvtM7eQjcqKujDYOoIxHbRnfDztEGQhB0OPtxsYMZgMIK5GHBW0r+kbplhwa0vh5lSsIM1PzAbH+GFiiwGwTVsFPJZXYlql+T7YM09WC98cCMoUy6JS7IU8pylq+9mD4YwYGadvBs1GG/t/FvB576BJlzqsu6OI7h5QsXL9BRMCxDCk4OPgkG8hoXeYoa90TFdoIH2+04YP/Cc38TALTWYyDw3fkB5FHwxzDuSoop78kvajncJAmHErrgcvYEqjz1+QV9LnLU/znrHOomTRgO7nIsCuO1c5jD7eb/JLnPLNFVCps4Ai8OkbdCQA1gZ6lfO0ba+tFu2xQ06kSggJ6eVt6EMyTmCOBnBrt+jJgsFERdGrw3zcx2GrKhciZ3P7dz+NcztBAkHTTimPsuK3ihrRDgRtj8ntGR3zVT8G+jeZAB4DOOzuqGKQA/LuIYPniWPuStkiN4lBv+caYWrbEbILv6xtDE/4H5MvlkXP/c90p53GL1iH/AVZgGUw2NesRKGUslGsuO3+Beqa62RNg8/4NkZgSqQoBd1Th6dMXLzJcFaoVU45Q3GygxCQj0xPOpq9OdNGlwMwEqrNULLdquM5wL8O2rOcl4F/IA52/p57umoHMgxj4luoOgnqF68FV4jAKC+2TT/nbhxEE3IWTZFp6fKbRATQ8Mj/LE2NFeDB9fdxKBakivfZq4nU8ZpAJQHFm5KASvAvbJ+IuzFn+zdY2bWTAyDZGP2TkY+ynQDybFJ1n9huBsvMrooI8cYPTp3lUM61+jZq9o0vw//yPGFfLXJmCU3ZAssrnQgeqYcS3rx9Pc9Nj9ZA9vl3Az9/GkYX8djVrP05csaVhSpo5WegtzWZD9Y02MKTp9NVlxI2J9GkMVXBiKMo4gyZJYWBEkkU6ptznavkNfEEz1iCiSr5NF0is+IbatXfP67266pOeCoGYm9vjX7LJ6HfuMod3petAerOLZrOGwoy7g3lQaLQnymI9arBTU4D+zmGqcmO7RS9QmYeRqRVfJBlWjkcQytNdnYXQPq6N8b6QMTJD2idgUIncV8i2uDxptx+uw/ayPkU524b08Cg6JQx/khEhUsmvCK0oG6DF40SuahVjDom7+Yb8BWcfnKrFngIr8ih/uQYaaTNloIUiugEPsIyr7jUODawh811BS0aK/QT/qP1P3OTj+9pINNSc12WyJgDEEScmve+3sJgiT55zzF6/kK3DPsaVTn62e6aVUX8PMGGdAEDwKaqKYPzS1zRByVGov0dv3LZRfPEngo2pdzfKlplXyzxgCiuB/1GEyjMX4ThpoMe7NUELm904/aCjMoooDcFqYyLSmTcWzcb5zI7roROwtqskXHOhUGJc79puqwUXh/EfSxU8PfsZoIn3PxVGM1aOznkksQRWmyQMi8qjworSPBAiQX1FBQ3Xhmf58E4y89922nw446zPIbldxuJE/zABNelu45f5GPk9x/nSg6d9NdR9ciOUyRF1KYAbIm7rWZLYJqnAJ5Qh8G96/VQDqxFoyL+kL3oGxb9OkABiThjOSQ8fTW7cHFcXpvAWQnU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f4f7261b-4077-48a3-cf93-08dcd0894c22 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2024 04:38:48.8163 (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: soydlZKPTAvgS/ww18kJpeHC4JPSg+8Fyfd9YpZdkrXHjLTSSORh5w/SRuTNd36zcMt+6F33L3TzhwNu9EKUWET/vnaCgffepV3JTuosdHf/ZxQtdA/BRi5AioMbPRHm X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11267 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 Reviewed-by: Laurent Pinchart --- v2 -> v3 - based on latest linux-next/master - Add someone to "To" who is thought to be Maintainer drivers/gpu/drm/drm_of.c | 4 +++- drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 2 +- drivers/gpu/drm/tiny/arcpgu.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c index 177b600895d3..b6b2cade69ae 100644 --- a/drivers/gpu/drm/drm_of.c +++ b/drivers/gpu/drm/drm_of.c @@ -504,6 +504,8 @@ EXPORT_SYMBOL_GPL(drm_of_get_data_lanes_count_ep); * Gets parent DSI bus for a DSI device controlled through a bus other * than MIPI-DCS (SPI, I2C, etc.) using the Device Tree. * + * This function assumes that the device's port@0 is the DSI input. + * * Returns pointer to mipi_dsi_host if successful, -EINVAL if the * request is unsupported, -EPROBE_DEFER if the DSI host is found but * not available, or -ENODEV otherwise. @@ -516,7 +518,7 @@ struct mipi_dsi_host *drm_of_get_dsi_bus(struct device *dev) /* * Get first endpoint child from device. */ - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) return ERR_PTR(-ENODEV); diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c index 4618c892cdd6..e10e469aa7a6 100644 --- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c @@ -400,7 +400,7 @@ static int rpi_touchscreen_probe(struct i2c_client *i2c) rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); /* Look up the DSI host. It needs to probe before we do. */ - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) return -ENODEV; diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c index 4f8f3172379e..8c29b719ea62 100644 --- a/drivers/gpu/drm/tiny/arcpgu.c +++ b/drivers/gpu/drm/tiny/arcpgu.c @@ -288,7 +288,7 @@ static int arcpgu_load(struct arcpgu_drm_private *arcpgu) * There is only one output port inside each device. It is linked with * encoder endpoint. */ - endpoint_node = of_graph_get_next_endpoint(pdev->dev.of_node, NULL); + endpoint_node = of_graph_get_endpoint_by_regs(pdev->dev.of_node, 0, -1); if (endpoint_node) { encoder_node = of_graph_get_remote_port_parent(endpoint_node); of_node_put(endpoint_node);