From patchwork Mon Mar 4 05:15:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13580070 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2062.outbound.protection.outlook.com [40.107.113.62]) (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 C0F6079EF; Mon, 4 Mar 2024 05:15:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529353; cv=fail; b=i5FggTdgu5rPuZbV68A11XOyWDC75oyap/P57jRmRtANGREPmUN6sU+eiMR/qgdE2uAaFSUXaFADbAE5HJCq2xuxjgT9JEyVvjSngBEJBMIP8gRS8SaHxIxbNabGQrKs8Sy30rri/cVUOKpR/ZwH2WPkf4kPelwG/dUAKUeZp8Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529353; c=relaxed/simple; bh=PBx3L/n694IQdZjtag+8/+Ruoe7fNeo2Ye6oAKrPhtc=; h=Message-ID:In-Reply-To:References:To:From:Subject:Content-Type: Date:MIME-Version; b=IVI21fYqOsCic53XVAuDjHiuKZaTyG6VaE1No9SRHE94Fl7DDJvaVpj1l3iQ1J7Lr4q5jhAV7Du5bydt0I5xhJlI8UfkR2tgrp3GFgnCvdkUF2OXvpAP3bJ2bZ1b2J9phC+8pLShhVVNVKMY9xBK2Qz1CM7gb+2I1UYE8flHvVc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=GpgFSVBA; arc=fail smtp.client-ip=40.107.113.62 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="GpgFSVBA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QUuQFx+d9dsn1xbMfkGPeP3zqDXn6+gJF5MNdanwjp43BtBRebtTJrR3T3m4SdRttZna9TqocCcIxe4eKghJPduwzYzhD4JYekPeRVr3BY1Kn5wP2GprHw0UyrNLIHMujl2zHkNqZG6WIqnM4B75EezzP8rbw/NcBGQ/wJyuwrZZF7w+vwkuqhVRdIl199Wdg4ayKTAvaqRbLeL17MEISpOrUVI1TPC+d3ubx9ffQ3Ojy+u+Inoxp5GIPPl9InBFvHwBAgNc/D4Ub3ypn7axRL1+Xff3Nrt6DVpweiAukv1pPT6agSfPe/knDyW8WZ+41DTTwjZllq9zMP620mGLUQ== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=Az2wD6v576Ct5UYpDvDQMaW7Z2X9kaUZhppFYrgk5TUHRUDPme5ozMbeBMcHEC0fgepdKWy7bxyQN4LoyeVokTZeV3Sau78fBVBLw9jSRIyGypLPDjxQx4ntnNH/ZZhwxqjPF5vbLP6+vH0SnTrJcYfXWxBvayPiB17w8G76Katd0Bx7ONQ8KoYX/SeT7vA+0lqCEDtdUa1knwbsa8LWmpAQanCvs6dZQsL0CdsD7lIA7cYsBmdsw8gAzyhj1+2MxYJ6rXLM46ASIFRApJlsXLJy5Dew7Or0auyaaAHUc1nYBhof3tr8yKxknrAuHTBgMmCxVABd6DgBG6i0kEv2xw== 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=U+nNdu9cruwklfWfBXe1iTRh4EtTiIw5DoO94oGqHpw=; b=GpgFSVBAPRajKFu9zDNUK/5G+4GqfBUuIgwYWMfSO7I8GiJnQoabbXhC103EBZMtuXrJNLTF0TwQsEAdE+IlYOFc/aedkIN3/4s9/kIpI8AhgoJHTju8sp2vEXBZwEfGF44TqJHZdsa2Fnl87+GM9bGlFVcvppCEExhQ/qWjrE8= 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:15:47 +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:15:47 +0000 Message-ID: <87o7buh919.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 1/4] gpu: drm: replace of_graph_get_next_endpoint() Date: Mon, 4 Mar 2024 05:15:46 +0000 X-ClientProxiedBy: TYWP286CA0015.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::13) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: a0306d5b-1051-422c-a1a3-08dc3c0a2660 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: Gelbs0U0e8n5M7glvrCs7WP8seUmE2yyuSeXKy4fzdnsOsMrvLOaLEWar/RpRSkAE879y9VpvK3J3mdgb2h41tljsdaC0tSq5xHq8u/ZsJQIILaJoIsqAoq86Jyn2AUyFJ3gQLeQ2PB30iuwbbSceUkwc5b7mD6X+8SwnNXklX+bAng62m5dk7aA649+6JveMh/5qDtTrrTgWpXwpHvAG9PL30kUM7y99QYEuflBDqySAu1kQSbsPBBJgJydLtX3KxCrfMSCQqy+71d/MA/H51/xqfGYJm4rKqX1HX/p+nYsZE5HhtF3YFSzsxhEhLA4I12tt8eIuJl0Dg5KxFfDuQ3g2uav2ud8bZogsYiELxW+dA7lwwNLV/83z4pO8YR9qDOELA9yw+472Vjg1n1Ms6m2J4vfuVaukZDmV35Bk0lU1VaBMqhUXpzHqf9SalaY4hBOfoZOGO00w+AoCx78PIjDEEb+O5tV/V9Tus2nkaO2aOH+UUOu62rFa6DYPYlW81CHoq4wdpOfwUmVR+VsaCuTrxOHFIhFpW7W/AXUQ176fB+JIeDMHW5wgVlnzCdJ0fsIZiGuLuFfKbgdxmrac107T0puigid/GLlN5nvT5dQDogF0E3oPU5Pf1eOY5+RCloW7FkjxVcP9U6ZK29midoHcYupkELKe4/skJLYvLzEGXsMEtgaq74JOSy5JKNa 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: WonskMxYEqfGDHPcO/oyG4jSCVcAtaLFl5gull6P6urDc/vI/U3xNqWtiCJHZ1Nj+dMnvhK3r4OSABRx9YFswp+4dbFFobgeCTFHgOEFq5igxW64aj1pQYRlqkLtQIaQBje8s8dVzIX2ymrTjKAFrhTla9jTAlPoNwc2MtG+e8MMMyfgXNztBPYjKr7fyeFLvLwH62CmfBlk6wahdFwaPCIh8Y4OeXLBfDwe1rDN3SgIlicm+xpHu0OsdeL+++qvQ23LsL2/OtOnbhKpD+M5ZwYzKphMwIU0KdhXbUbwMZSnB3rdh5eyUsx2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XbXLEUD6OXVFn9f3Zc5MOzIIOuVwLurTk9PAWmbfydRsXYfLYFQYMqepI+PY0yZxjuT3U5qChpPd2Mp9opd/0Y+e+41PNDJ+V65lA3SU3ZEm1wyl6F7WojoVKCzoJA2LKigPykaJk09eSXRba7RkFXvkyj+mMLjXye4AxgrP4tQEegeolbCSoUV5xnfLiX9B+EG4QN6BlXglY8WI6wVrIgqoO2SRAiWA4GkcQQhH4+qByIbUM7eykQyRDqslF2qBZIaFAFxeZUYo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0306d5b-1051-422c-a1a3-08dc3c0a2660 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:15:47.2389 (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: Xr/UyTOcksQEwMT+pvwMtyOLy9rbICTLFfNj5KW7fdqoJI2T/W2bxTD6V1aWLECOBSB2kyNwQucPVgmjrUbmgVaUSnIBN5jqlx1/K353r7btrIHoTf/Yl7SIaS70vgIL X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6616 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 --- 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); From patchwork Mon Mar 4 05:16:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13580071 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2042.outbound.protection.outlook.com [40.107.113.42]) (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 7F6B4BA27; Mon, 4 Mar 2024 05:16:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529372; cv=fail; b=NVBV21O+d9K6M+0NAzi8FxaTZ/PQCORNSdSTw6cTg6Y9FoKyI+RQnYOVvVdwXrD2ZWXqAGH1TcKOfK2l5pR+3xB3GpuM8DkO9sbsN1CDLx+F//oabGrT5GCq8htqnvzkz9RN1Jo2HED8C9VgtxitlO23Jx/9vaRQmEE0g2sC0tQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529372; c=relaxed/simple; bh=ACJsB3c3uRSOq7fiK0+Topl1ll+h4vxSHGo6LRKP5ac=; h=Message-ID:In-Reply-To:References:To:From:Subject:Content-Type: Date:MIME-Version; b=a/ox2K1iBW+1Rj+nb5QsA6OX3OnrxVh9b7HRcLO42wBeGCRCYssLeOt5wiPwcThWXn5gR3IY4o5vFjzzSkk77+3CVbxoNlSa8vIyMReUXdt5WA3x/Z/NKPOw9JaukQ6csyHert0dJsSxgs6r2gA0+L1fqC6nSKz+wCU2G8OXyUs= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=N5EPfGSq; arc=fail smtp.client-ip=40.107.113.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="N5EPfGSq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G4sCZqc+KjXNPuZQWAi+uva8+E6krowfYosXTJpRYWzJKsO15dWKKuTux8sn7c++00eZ+4UFh50Jy/55QtdX0qbOx5th2qT8UjixXjTDzH2Gu1gBDhTXu11MPVJZdRQPTKx++45Jg229G9MN71iLldUN+vRz94MNmF9fU1M6E41VWkreUG/aVJcjCEz2eyGhyvwh/UtU7oguSVAc1lsOj8JhSALihUGpJ7NGkL4cEyt0zTNCavEzNd4VSLmQGxAojL0Afzmz8Hl1RUJKkiVXnVHeR/1MsvnuUiJNUDWbIVcNy/v56ZdWrIXArJDh5Mb7JPdsRY0c3VpVs82/5PYYMg== 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=o7lQcPCnpEicxp36lyHMSuSuqJ+WxW2JpXlU2FrAGS8=; b=LHSxpSJFiaasUmo5ohk9AL/DlpRsGvpUgoJ0p9kO19CGQncRoNxv4kjlPX9YlXownuzjjY5WLdozl9evncKCCCPc+aMMfv5BkMbzAJQSoI2DQR2drAHivYrntzh1ceMdmXo2okdDu7H6Hn3bB8sldOgTbhpAb+s9zjtDs7cBucdbSzVf9RmXq4wozMyYpaTqi86Gz7RkFa+n1LYJRZrhXDbSM7zPqhKO7Wu9WpRbLFyxYNcLXhUEbqcrmPyc0wqPkCtWPWmxGRfCQLs7ggxlr3n4DO1BBTpJ0MRiIy3yhDt5IuKLO1BrgT1PcYOeQMc4fOkLPyG0FHeEPQ8p2P6Lew== 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=o7lQcPCnpEicxp36lyHMSuSuqJ+WxW2JpXlU2FrAGS8=; b=N5EPfGSq/blXTa5/njJulfBb5IZmZTlpM3dYZfd4OQHUMZT5FjzyO0fhAEV/v6OQ0veTIcyHEKcstM0Rat/UfPxX4CTt3LMktwCmKjCbqpFA/BHLalsgL+YTtftuh6Q8rj+ChR5jjn7wsVhXrKhJp3l5ewJ0AE8tkAYWdVM9yUc= 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:06 +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:06 +0000 Message-ID: <87msreh90p.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 2/4] media: i2c: replace of_graph_get_next_endpoint() Date: Mon, 4 Mar 2024 05:16:06 +0000 X-ClientProxiedBy: TYAPR01CA0032.jpnprd01.prod.outlook.com (2603:1096:404:28::20) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: 3cfc520e-d541-46b4-2f39-08dc3c0a31fd 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: vMQgnG0E2+Fg7Xx9hs1EciMqsd4hE6/ZRy9ED+wMk/NOsIzipLur5RhVErB1W0vgY6C9Uf35kaK3n1c5rR3QE6Sx4xuLhNzusNOrG1Ztl65K+z5vnQEYXL+9gzDka0eGvoZ/a/Asiygm2uzkBnLf0+l7bUEQnGtRskMzHWoxz3T0gRR4XlSJ2PKkTXjg5DdfMhkVOa4WgELd3dKcFM/E3QZfxUBkcJA+GA4pBcvcyllAmMTWc/nQancksOA8kJ0VXegJiDH8HMo+IKNAzLBCPKgArFXxINHk1U8jaA4L2s+nsCDMFU/hNIrfnKt1WVR1UOyh6FFoVekH7b9pMqMqCLqHFYsES+58gfCQWu82UM965VTGRZ/XlGI9lvLzm/jT0z8ahOmM2s9YnXiNkPBSV4Dqu5Q12a3tS6JMLprfBlq1YrzjZJBti+R5v8nLN33mZqnZs20PGQPV62Xt2WFKJsbOJgpZ3lAVS6HPoEN8QzWzUZvRmjWwTWBuH2a9ZCizix7zFi6lbFQIfcginZdzsryIYMUklBSpCJQg43y2/Wun/PiPXmISJnTWiC27n64vpSG1En6vUWJBiIBTOOhMlgnjFKuyaU2VxSBckhEu3WuVy/itLVCwJFye7DNAaPSw+/gn7TbQMkfUuIwk3hQciZbaQXkGjfLYHxw6dP7005Uhkdph5yi7saEZhDnyGDNC 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: UXqbD4MipEzUTLVcsVsncL99vRmxLqQjAoaiEcNqUDfjEzCry7NK8RD7/gzkFx2S/6KUMCa7nY+hASSICr0Hz8BpWine93SJg4J8JNn4yVl/YhMuDuTVj5+HHh1J4DHZ9xJ4x0xIBXt88a6B85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sjt4WrYS365Ra2h2vgie7EcWNY+rtM6sifIIzR+hy0bbOF/Fq4GQcLutCStJSSjDtSWTsl0F1i2WYSBYIyYFKzXkExSDBDZVCvrMjQbKQHrjdycdOMZxUkEkPMH3ZDpDK9Ko76ZbZsR0FOtuAl8LsvEqJt8w4WiqS3AhO0GF+b88wq2oWTXhidXFXpCgdYDwsGlh9SU9APi14Dn1++dwGI2bRnUWiDxND5IkuYG48ddt8VjG8AFWxdQafvZbzjcw5ZCjdt7yekQynon7DNBHmBTnkQMSebi+8jT7Ee/I8AhYPw8fwURS0/wTDxgwdaHCAc3q55ctuNIT2rnTazTTKYH9qUtitQlLNu14bjb5538GxPmHQ4k/gSIYVaX810Qx/aVb1vaSGRGxUBDNfoJasauvRQU23UFls= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3cfc520e-d541-46b4-2f39-08dc3c0a31fd 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:06.6957 (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: GxCmLzoyJofO0FH/kVpjPHZJjf/dNripP3SiH/vZHCfgJ8teAKn7lOLTMCig7SykywsUgQm1yG+mNoYNe1QGn6HMItJ5aNgVgyTUv7xC+L9Pb5reya9eM0gd8WkZ27Bm X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6616 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 Link: https://lore.kernel.org/r/9d1e99b0-892d-4a72-a9b3-886b8ed094b0@xs4all.nl Signed-off-by: Kuninori Morimoto --- drivers/media/i2c/adv7343.c | 2 +- drivers/media/i2c/adv7604.c | 4 ++-- drivers/media/i2c/mt9p031.c | 2 +- drivers/media/i2c/mt9v032.c | 2 +- drivers/media/i2c/ov2659.c | 2 +- drivers/media/i2c/ov5645.c | 2 +- drivers/media/i2c/ov5647.c | 2 +- drivers/media/i2c/s5c73m3/s5c73m3-core.c | 2 +- drivers/media/i2c/s5k5baf.c | 2 +- drivers/media/i2c/tc358743.c | 2 +- drivers/media/i2c/tda1997x.c | 2 +- drivers/media/i2c/tvp514x.c | 2 +- drivers/media/i2c/tvp7002.c | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/media/i2c/adv7343.c b/drivers/media/i2c/adv7343.c index ff21cd4744d3..4fbe4e18570e 100644 --- a/drivers/media/i2c/adv7343.c +++ b/drivers/media/i2c/adv7343.c @@ -403,7 +403,7 @@ adv7343_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - np = of_graph_get_next_endpoint(client->dev.of_node, NULL); + np = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!np) return NULL; diff --git a/drivers/media/i2c/adv7604.c b/drivers/media/i2c/adv7604.c index 810fa8826f30..319db3e847c4 100644 --- a/drivers/media/i2c/adv7604.c +++ b/drivers/media/i2c/adv7604.c @@ -3204,8 +3204,8 @@ static int adv76xx_parse_dt(struct adv76xx_state *state) np = state->i2c_clients[ADV76XX_PAGE_IO]->dev.of_node; - /* Parse the endpoint. */ - endpoint = of_graph_get_next_endpoint(np, NULL); + /* FIXME: Parse the endpoint. */ + endpoint = of_graph_get_endpoint_by_regs(np, -1, -1); if (!endpoint) return -EINVAL; diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c index 596200d0248c..f4b481212356 100644 --- a/drivers/media/i2c/mt9p031.c +++ b/drivers/media/i2c/mt9p031.c @@ -1078,7 +1078,7 @@ mt9p031_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - np = of_graph_get_next_endpoint(client->dev.of_node, NULL); + np = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!np) return NULL; diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c index 3ca76eeae7ff..e9f5c6647f97 100644 --- a/drivers/media/i2c/mt9v032.c +++ b/drivers/media/i2c/mt9v032.c @@ -1006,7 +1006,7 @@ mt9v032_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - np = of_graph_get_next_endpoint(client->dev.of_node, NULL); + np = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!np) return NULL; diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c index 1d0ef72a6403..d1653d7431d0 100644 --- a/drivers/media/i2c/ov2659.c +++ b/drivers/media/i2c/ov2659.c @@ -1388,7 +1388,7 @@ ov2659_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!endpoint) return NULL; diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index a26ac11c989d..9daf06ffedf4 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1056,7 +1056,7 @@ static int ov5645_probe(struct i2c_client *client) ov5645->i2c_client = client; ov5645->dev = dev; - endpoint = of_graph_get_next_endpoint(dev->of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!endpoint) { dev_err(dev, "endpoint node not found\n"); return -EINVAL; diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c index 96c0fd4ff5ab..7e1ecdf2485f 100644 --- a/drivers/media/i2c/ov5647.c +++ b/drivers/media/i2c/ov5647.c @@ -1363,7 +1363,7 @@ static int ov5647_parse_dt(struct ov5647 *sensor, struct device_node *np) struct device_node *ep; int ret; - ep = of_graph_get_next_endpoint(np, NULL); + ep = of_graph_get_endpoint_by_regs(np, 0, -1); if (!ep) return -EINVAL; diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c index af8d01f78c32..cf6be509af33 100644 --- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c +++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c @@ -1568,7 +1568,7 @@ static int s5c73m3_get_dt_data(struct s5c73m3 *state) "failed to request gpio S5C73M3_RST\n"); gpiod_set_consumer_name(state->reset, "S5C73M3_RST"); - node_ep = of_graph_get_next_endpoint(node, NULL); + node_ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!node_ep) { dev_warn(dev, "no endpoint defined for node: %pOF\n", node); return 0; diff --git a/drivers/media/i2c/s5k5baf.c b/drivers/media/i2c/s5k5baf.c index de079d2c9282..6b11039c3579 100644 --- a/drivers/media/i2c/s5k5baf.c +++ b/drivers/media/i2c/s5k5baf.c @@ -1849,7 +1849,7 @@ static int s5k5baf_parse_device_node(struct s5k5baf *state, struct device *dev) state->mclk_frequency); } - node_ep = of_graph_get_next_endpoint(node, NULL); + node_ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!node_ep) { dev_err(dev, "no endpoint defined at node %pOF\n", node); return -EINVAL; diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c index 2785935da497..872e802cdfbe 100644 --- a/drivers/media/i2c/tc358743.c +++ b/drivers/media/i2c/tc358743.c @@ -1895,7 +1895,7 @@ static int tc358743_probe_of(struct tc358743_state *state) return dev_err_probe(dev, PTR_ERR(refclk), "failed to get refclk\n"); - ep = of_graph_get_next_endpoint(dev->of_node, NULL); + ep = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1); if (!ep) { dev_err(dev, "missing endpoint node\n"); return -EINVAL; diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c index 1ea703a9909f..8e4a0718c4b6 100644 --- a/drivers/media/i2c/tda1997x.c +++ b/drivers/media/i2c/tda1997x.c @@ -2310,7 +2310,7 @@ static int tda1997x_parse_dt(struct tda1997x_state *state) pdata->vidout_sel_de = DE_FREF_SEL_DE_VHREF; np = state->client->dev.of_node; - ep = of_graph_get_next_endpoint(np, NULL); + ep = of_graph_get_endpoint_by_regs(np, 0, -1); if (!ep) return -EINVAL; diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c index 5a561e5bf659..f9c9c80c33ac 100644 --- a/drivers/media/i2c/tvp514x.c +++ b/drivers/media/i2c/tvp514x.c @@ -987,7 +987,7 @@ tvp514x_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!endpoint) return NULL; diff --git a/drivers/media/i2c/tvp7002.c b/drivers/media/i2c/tvp7002.c index 30831b4b56d6..6a04ffae5343 100644 --- a/drivers/media/i2c/tvp7002.c +++ b/drivers/media/i2c/tvp7002.c @@ -893,7 +893,7 @@ tvp7002_get_pdata(struct i2c_client *client) if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) return client->dev.platform_data; - endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); + endpoint = of_graph_get_endpoint_by_regs(client->dev.of_node, 0, -1); if (!endpoint) return NULL; 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: 13580072 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2080.outbound.protection.outlook.com [40.107.113.80]) (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 65977BA27; Mon, 4 Mar 2024 05:16:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529391; cv=fail; b=HX+Ns6H0HUbZdEEL/ujzf1qrbCj6zc5JD8wfij0ekTxWkCX6MdS1GChb3GDgGYicDIu7tR6uQL7a+LXCo7TS84s7UgjMTdjKoJJo2nZp20W8BndZFjNHGmBSKEknOm8YG/2HTmc5dA0OaNsgPXb2qpreFAQ0AX8szW1eUcOsoRY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529391; c=relaxed/simple; bh=/H5xJxo3+eBZQS2HCSsmXz6ntcbSZFlOfBUGRn86mEc=; h=Message-ID:In-Reply-To:References:To:From:Subject:Content-Type: Date:MIME-Version; b=KQSktLNqcDFUh+8NTFkl2nQlOyRXSIcw2QlfX4eWX9HfmKmnsl/+zMCR2jHp9IezgLNKc5N3AdmvOer5tkGOPiByeEsN/7c+Qy+mZdPTsxRLhM8LRx9hfeNYaRvBqrHIa/H3O7T4LFakgbSZpAAqeYS+AEG6pC4zb+Q6wOEHpvQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=or0Vxr1c; arc=fail smtp.client-ip=40.107.113.80 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="or0Vxr1c" 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) Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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+WbrBFpjTt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UCreRWxdt5hI5PfIuMSFbHRSC5QCBSAbUrVbbPAu5+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 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); From patchwork Mon Mar 4 05:16:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13580073 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2053.outbound.protection.outlook.com [40.107.113.53]) (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 C1639BA27; Mon, 4 Mar 2024 05:16:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529406; cv=fail; b=lh1eNrlR7JNLyuh3/CQVtagCa9szKAYlIOCVesdNP8FwGOqbnu9iCzRaRldXnMrzIinXLeF2UytiRtSTvORq+FeOgVpPIZKyIVXhcSnbFa2Md8EfYnN7PGa/mJP6tJsgMk3+EtVmkxmjQ4IpdJzZeaQu0G2qsvTlI7Rx10zXjAQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709529406; c=relaxed/simple; bh=9D0tmht+UC/To/BNPPRfPIWvJEuU7lMpnpfq5DQo1rc=; h=Message-ID:In-Reply-To:References:To:From:Subject:Content-Type: Date:MIME-Version; b=EEKw5+wnXF/hPzmjA8/1DBai2erYzZ6iLDqeKVSYHawIYBthmtEDj4mv4qODJSAwhP7HK6UZlCDqfUMnd35OdOqqZS373KKSsEDQWyeWDsazIemrqgDqfRGWZ5etWoFYEqPN36N7+po+g+QIUqarcuYF8Bf1F+UhDjG2TITar7c= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=L3Yvvu5w; arc=fail smtp.client-ip=40.107.113.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="L3Yvvu5w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NgnnemBLyd0JX93vUseHxxw6EW1dLdMgV9/ysf8LJcYw3hkuDtvSWQImOOJpQTLkg+7vjUYw5NmMBSAEm/fIUzkGCqv/blR98ZNuywXdJzePTzoWFGsDc3Frz0xvHkUCC0nlYYMFcH2jHUfAVO0XEtKhsT1YQix/RawfT/Ud/CnP+nOt0Pys3SETefWSmy4TmG/EWpEuX92aepqsPCO5fJ87gVyj06aibbNtnCZ+dJUCAuYY4yZkWmksKZG7m97QQ9NBcUyBuLzlD4Aloph7qTVSY7qHSIzHmVlHUSTue/GoapfWPoi7IXV3y/djTgiHkiyKfQ4WXQuBDKHWLlK21w== 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=iPWy+PYtnAvN+6i0I6jsdtewufqRlqn7Qxjn1KjTnik=; b=Dhj7B7q0YAbds3an2/uDPVIWRomeNzWcEkwKbEIEkxTltkgK3fNKGriBHWJzgghRsTqv3lpOo9wCVigEUHWHphkbr36qVWX2k/Bqd2GEHYuw0yj80WhdU0Hw0pFPjsWC3QmA0ShDty/+L1zvUtfab6RYrwxYLGzF+pjAWg/ciDBnCaXSckdoGIFUDmtKDensuOptU+etd5kB0oO4Qg2vXFYEVz2FOybbCWDndbawQ9kURBlNRIqk3nkJTE578imPsNm7LrTKvFjpJyaFEnig6CVkvZ8WrBiUQVZ5usCxbaci6crPrVIkPY/cesYtkBs5VqiWE9ux6vQ2CF+4p71T4A== 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=iPWy+PYtnAvN+6i0I6jsdtewufqRlqn7Qxjn1KjTnik=; b=L3Yvvu5wrTS0eFs32MUsSh9J2UL/PKq/Uf/7AhIniPtnKajt33Cwhv9ZJJiYoldnLZH5sp62imxEjzKkSuDtMkA60JArxhpwOF/uSxvGZMDJYFUbTGjQafZ/dxKvBmulC01fdWAJXbcX4RUuCTC/+wrKW/vUhc0i73ZE7R2dwp0= 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:42 +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:42 +0000 Message-ID: <87jzmih8zq.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 4/4] video: fbdev: replace of_graph_get_next_endpoint() Date: Mon, 4 Mar 2024 05:16:41 +0000 X-ClientProxiedBy: TYCP286CA0130.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b6::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OSZPR01MB6616:EE_ X-MS-Office365-Filtering-Correlation-Id: ce6f1ffa-ad5a-4f71-8bc9-08dc3c0a470a 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: 0yeRBJMdvOV/MHZmmaEQlT3LNiGRRzxmZks+64Hk4BQZzfFb7ZqnxAtq2eMWxvdfANe/0irG2/6cOtkdIVyL3OnGlEUvGUERW9+djVx4ISARbGB4GgVVdQGEw1qHdMkBnB5E2T2Xx6mCaR7qNdacUeepu93pv1VAm5ofEU5ovr6lGQG87FmUjv9MAvh3bBU6CpG49BeUkgv3Wt+06GpTSS5ba3BngM0x8ZhISCoRN9tUh5aDm1y6c8dtPKqGDObZJYMhIA/7boFp3wJyXiS7EBRx1C7o7D/IbGBi+0LipCA4UTc3acJuoc4K0elglB5tul2XRQgGHfzQoRpBm/ds7G2anEzv3WQa3QtwLcuMwvP9Lw7vEAZRPwqJ5ZHolVtcRBi87qWc9HduYJ6d526j2X6U4SOHqJIMrqBV0nEjkzTA9kwBdXg/XlOlVO+eOKFrzQ20beDvm/CKgLkbROYmpQ4z+dgmYIppE1hU2LVB3Xddbur4TVb+y8YhuJE95CcaoZ6uiR4DVAkTj5GY4WAJSZbJOar0z0ztriP8Ce2squ5T7wqR7vL8G1/jXeNFqChPAoYs6oy2NX0GVdPTTOv06beKWJfYPXIBFLXNipeSA17B/+0vIMAF7hurHicmj+qPwrF0nJAog+OSK/PFFW0MQeXWT5krl/DcO/kUUcojPjGubr7U5w47WFv1GXhsnKai 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: IvU4vwrGHc5Vd6eJhNTkPK5uRVJeeOKrarNLItYzXj4Jl+rRaBvykgX23msseZRp8MO5AlqRwR6F5Q6V1AsYZGxJx54tPOUZ5TC1up6L9ai6AlN8Gu8SV+qlPS6goQTvv2s93eo55rhcC929k44dKsIDWUI9GYB5LeQTPOolByNvXlOcpzPJFhO9ZW6HHjjUt9wusa/Ts31uhKO8/+XW7DggVkObrconXsXkUiiBxOXtt6PQn5AdhIaRuwwC+tIB4LkggH58p+DGiELlCjlWzMVk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RVoLhdc4WzKD28U26jt/irUYiv2zLMQFY36UZS2q3xytf4FlAfNR+tq6cugzKaYKac8uzprSK84ogN9XrDEQ4yETNkn7ZUWVPRQsAE9rm4dnWijflSmEZ+MnAcevjFgebmjnyV+WPhHZ/7lmO63ekUgKdZDSS9yLrpNkYCU3y+LJ9VQO8fcFq/g8fgOBq24d2p5HjQkcW/HA2Hk+i1UvaQFjjSQcR0WMeftsOqa4mnHJBgrZ2sPW4XE47EICBvZOJRTMiY6xPKSpQSE6Cz9c= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce6f1ffa-ad5a-4f71-8bc9-08dc3c0a470a 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:42.0006 (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: u/YeQt0iLyiGlUAXtyF6YJdBdL5yWM9uUuvNWZmTSo4Mlb9TgZyVNHrestba5hrgBguSA/HeosSnh/ItW9VTfYM6V4ncZ9ha+jGJ9PDBrP025UNEAPr5eCttpVHjJq7j X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB6616 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 --- drivers/video/fbdev/omap2/omapfb/dss/dsi.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 20 +------------------ drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/venc.c | 3 ++- drivers/video/fbdev/pxafb.c | 2 +- include/video/omapfb_dss.h | 3 --- 7 files changed, 10 insertions(+), 27 deletions(-) diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c index b7eb17a16ec4..1f13bcf73da5 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev) struct device_node *ep; struct omap_dsi_pin_config pin_cfg; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!ep) return 0; diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c index 0282d4eef139..14965a3fd05b 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c @@ -130,24 +130,6 @@ static struct device_node *omapdss_of_get_remote_port(const struct device_node * return np; } -struct device_node * -omapdss_of_get_first_endpoint(const struct device_node *parent) -{ - struct device_node *port, *ep; - - port = omapdss_of_get_next_port(parent, NULL); - - if (!port) - return NULL; - - ep = omapdss_of_get_next_endpoint(port, NULL); - - of_node_put(port); - - return ep; -} -EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint); - struct omap_dss_device * omapdss_of_find_source_for_first_ep(struct device_node *node) { @@ -155,7 +137,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node) struct device_node *src_port; struct omap_dss_device *src; - ep = omapdss_of_get_first_endpoint(node); + ep = of_graph_get_endpoint_by_regs(node, 0, -1); if (!ep) return ERR_PTR(-EINVAL); diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c index f05b4e35a842..8f407ec134dc 100644 --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include