From patchwork Mon Jun 17 00:59: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: 805009 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01on2040.outbound.protection.outlook.com [40.107.113.40]) (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 17BFE441F; Mon, 17 Jun 2024 00:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.113.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718585973; cv=fail; b=TIGHt0kLw9z/Vdgb/gq93RJIH7A/HfL6hFKu8q2K3S/nLT/Vihl+PeYHunNk4XggnPalt5LrSPU9v712TIVVeG3pqjP08lvcfOQHGrsYu0yGhYI3x3BGLSqJs41XgIAmBzbQ8yejhjnfNuG42ZHxgFaSF8f/yvUxcU7JxweZv7Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718585973; c=relaxed/simple; bh=Gj7gZCmCXBxP7NSFq5kl6WHPm2h/Iad/8G3zfc+eHok=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=NdQ1WpHGeWTwVia0EA8EmCT5UNWeU2kkC16c+9D34E4Rk7yOBXP0H1WDymUdHYnQq/q0p7lV9nB07BY5BQ5t+LVO0t/im+TL3icA4SxCt7v5m31iNIR3bCAlT149nEf1w+ktmkA5raysK7WxDRuczjyAX+LH2ttJnDisTmxvg/4= 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=jPv/e/1r; arc=fail smtp.client-ip=40.107.113.40 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="jPv/e/1r" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jNDJCf8cEm9JUltP5chsPsUjMPxdkrVvI45L0xbiNVtMZRqtYATT+eYXrv563pFwxePux00BMg4y2yagjcrUQLWbKYPRpVfztCLeZlW6Piju4fWYmFxyEWZn1JdBeNGYu0PWzkUcLVOX1UCVZ74vamU6QZLo8xRWHjxNHCKvGGM//8GvMmt2//sMsC5v07p7JIt9/pljrCvz1XOcWmzdtz2l9dUk04Sk38GNc9aEhJJL7K6GybT3QT0j730Hf2dQf+OfiCpyXkGxBYAh9b7b9lqQ+DGuFh5jGbNzA+/ptAW6b9WXmUZAIOvMqR/jTWy2u4sIHjJknyOXbmzx1SgOzg== 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=UyTYNVFuiPWsFlVH9oyG1GODHOUjUOsgwsvvhJOqvV0=; b=JBUSfZ3Kv5vuquzKI8kuhQU6L422r9g21zyiY0tqe7XOvTV4+la5B7XRsavD/vo8hzISZPognLGjkpr31LpA0jHLVh8w2r1aLzybK4ZCinH3Nm15UqK3QpxhlPvWlko09Pj6EgnyGjeXhKfUPpBDRso1qye+zxD4MsWherH/Q6h90rd8+Pf3aXZKs1TcCw+UVyhTuqAmsxlI6w8EPnDXXAN2Sh7aMhj9tpXzPH/5NDvTZthWnX5CXcvjoF6OescZHZWT8YxAjYlHge4FZpzgRg8qU0IH6BAWngNLU7ESfYNIxb+6YbqrdL4Ilru12iMJHpM739qtmYE0SDhwEhfKDQ== 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=UyTYNVFuiPWsFlVH9oyG1GODHOUjUOsgwsvvhJOqvV0=; b=jPv/e/1rvZRAeSl9DF+s19NxneAw056odKS/dOLQ06gTsYL41/9XJUpJhzZvqMGpvJw9RBgYmuJdvClUC/C4jG3H4y8u4XgD6Jc/smiWQX7k41NCx7tQ5/E/YW4pTclZ39+MjWKMDtH0nV9rax/UL7aUQCy1GYjbMWl4nJxuN/4= 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 TYWPR01MB8560.jpnprd01.prod.outlook.com (2603:1096:400:13f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.30; Mon, 17 Jun 2024 00:59:27 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%4]) with mapi id 15.20.7677.030; Mon, 17 Jun 2024 00:59:27 +0000 Message-ID: <87le34s7td.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v4 resend 7/9] staging: media: atmel: use for_each_endpoint_of_node() To: "Lad Prabhakar" , Alexander Shishkin , Alexandre Belloni , Claudiu Beznea , Daniel Vetter , David Airlie , Eugen Hristev , Greg Kroah-Hartman , Helge Deller , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Nicolas Ferre , Rob Herring , Suzuki K Poulose , Thomas Zimmermann , Tomi Valkeinen , coresight@lists.linaro.org, 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-staging@lists.linux.dev, Sakari Ailus , Hans Verkuil In-Reply-To: <87v828s7v0.wl-kuninori.morimoto.gx@renesas.com> References: <87v828s7v0.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 17 Jun 2024 00:59:26 +0000 X-ClientProxiedBy: TYAPR01CA0148.jpnprd01.prod.outlook.com (2603:1096:404:7e::16) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYWPR01MB8560:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a901168-d2a5-47eb-3c32-08dc8e68bcbb 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; ARA:13230037|366013|52116011|7416011|376011|1800799021|38350700011|921017; X-Microsoft-Antispam-Message-Info: Gew90t/xjpaU7IKssLFkW79YA5lz441f7oB3NVT31DVGKLOVYZumV3zXq6pyKwHFM2gFjILInLqcI4ji0smtr8UISx29jErego8Dsdkc+Qws9egES3yTTIPMsN08lTFhItTiYFpNb2CKr8nmDq32WvFY+O7r9lEG99Uzm59Skl55KsRywU+HUHcy+f9KEs1aVyAvtTm11hsiLNeqwqPfCi+L8qAVPuGA585Fyk/dGXfLsMWJnypWc5p5eu2agSEI9+FY9LEU6q4nsfeLqFwHNV6dQtGlxoTPZTHW2h18nZJu5CiU+VsepvE4kQ3wXtvX6DwE8UwtBH+6gT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3jp3EJTj6W4c 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:(13230037)(366013)(52116011)(7416011)(376011)(1800799021)(38350700011)(921017); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9ZTwFgDw9ah75GxkagQYPi5DzJEHwk0g6f3Fx/PKf9+Tk2zGMbkBv76M7dmFctR8qjxr/iVEl62oU4ybHKFfzRZfW2h8zJcbDHNGAYn2p+gyKjBGQTwVjyrd9N9nhjOGNiM4j6p66EMOncJPzrqMP7xinNC3HWE0krlNDKoF4a/dupw24SgF8zAnbsl4p4VWZtikP/tFtf3aktHhWzCjCsxvMbqoGt2UZSbT78dXQYD9FRRnggmoxFE3Tj/D3slvxMFOatYd+/xnS9Eikx+u2TBiukvFhgf4XeLyszoPl2Bsid+MxW17JNuKgNxa7tMfNnYdPPVrCtc7GpkZTdy/mcPNVDJPJ/oJMer2qSp4qDVQUD/9h7gTLujYEaInwfHKstL7hHnavqgQkO4n9laUXJ2vZJ2NMB4H7vrnh8IP4BSMPLuf33kOBtZrLU1Aqbk+yICz32J5eqcmtw0JkE04+T4P9c6UmorC8xJq7ATWZ2nmpnEnGMYTAj4zqLb36nSbdDWo6REbIRBkfAq5Sqgj30tnq8K5Cw2QyL4xytJum6WVburussYkrH8wuYAl7C81jRezIAcPwQE08MgGOSENcP34RcZDMXXq8EuGg+LesICAOfLUT7yfxFPvboZ7021xrx1JERwzyAGCk6IRkON/S2gr1hM5jtTa0KJd6xXBdzYK8RSQkBYig45Joz+rxhG3GQyBN2KJReZf0Ar9K+k5KjGHVp+vqxU/1wgC6fGLEStYHWPl/fbo5kiZDcQNNpGoupmbYs6FQg/s+n6/TJiiMv3e6mc7M+QNvVAwT8S96ag04dIodYnbGYA5vdZu9HUXCakzrBtfapox4u0cQ3QcPgd4PHmqtPJAItxKfQpZqollqK9OtZwEDz5hJUh7eI6uTVXJRAQUqN7jAWJRuO6UKxXCB+vMPBffBEOXaSO9iF2i3WbglKqg5YG5dICFEERhrqffjtzgfLdc3NWtSMk1wiaE125ul/95xesE2/UiYjoma2FZakwe0UQ2DfrAS7kJwCPwaR6lAsMJOM5MTjP7XZyvnOzaJt1MgqftbRSdn4Y+r/sZ8F2d3ZMJj3KuIrJIZllGVpLiXta64wRgc2aNljujN90CPYT1FSK4lqkDmB+qlNryIiaL6NpfCiyBqR7sVb/dodnB14pHfHn1GKVmJw9REuCykRJhqGw1U5CzZqBnpRoVwaXXqfoKFlnEn5aDpmU0TeXNi1vz6tzuwgME+9cIDjNt5jQ0rx5w9WymZwUfRL2FELuhi5KuGqhQuE+xP4DrVXwdqjclyGUUX8JS3+1l0oKfe/qRNC8XkrzbYqpc92R2E9cljfugLEjYBUG3X5vxJFooUukBLNNwiA/D/o9qCUTWJ6nNmgt0UZSPdA5fSB4TlTqj3aNsnUQ3Ix+zNUgcRRNA3B9GnpQ0cWKURsku31cAuhORVkpKW3rFcGa+34VVvG7txWc9fnz2LkGDbkLFrJBr08/zTVIJrRQEAFsEAKYMb9RpGIyAGuFJ/mwtcdtM8HyCmYFNayMri1dZI1pVliI5ILHP5J5smuteQNZMyfi7y4gRVd76fo0nF7aylpsGBIJ7CrWqW6wzWppqUBj/uHfDPQXHBv9a+DtLfE0NSNxut1mG3wivsrkz7Bs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a901168-d2a5-47eb-3c32-08dc8e68bcbb X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2024 00:59:27.5336 (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: W1PfOw9wcsaaFEiLi83pESmnilzkxCG/VbOgbN1cYrXhSUm7M0hut/JNjdHUnrMb7g/b6vYd2NdLx4ElPeyReGHO2eQNIcyob1P7JLZiLH2aBwJakUahu+G7FkkSSmLV X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8560 We already have for_each_endpoint_of_node(), don't use of_graph_get_next_endpoint() directly. Replace it. Signed-off-by: Kuninori Morimoto Reviewed-by: Laurent Pinchart --- .../staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 10 +++------- .../staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c index 31b2b48085c59..712f916f0935f 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c +++ b/drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c @@ -333,20 +333,16 @@ static const u32 isc_sama5d2_gamma_table[][GAMMA_ENTRIES] = { static int isc_parse_dt(struct device *dev, struct isc_device *isc) { struct device_node *np = dev->of_node; - struct device_node *epn = NULL; + struct device_node *epn; struct isc_subdev_entity *subdev_entity; unsigned int flags; - int ret; + int ret = -EINVAL; INIT_LIST_HEAD(&isc->subdev_entities); - while (1) { + for_each_endpoint_of_node(np, epn) { struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 }; - epn = of_graph_get_next_endpoint(np, epn); - if (!epn) - return 0; - ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(epn), &v4l2_epn); if (ret) { diff --git a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c index 020034f631f57..9485167d5b7d7 100644 --- a/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c +++ b/drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c @@ -316,23 +316,19 @@ static const u32 isc_sama7g5_gamma_table[][GAMMA_ENTRIES] = { static int xisc_parse_dt(struct device *dev, struct isc_device *isc) { struct device_node *np = dev->of_node; - struct device_node *epn = NULL; + struct device_node *epn; struct isc_subdev_entity *subdev_entity; unsigned int flags; - int ret; + int ret = -EINVAL; bool mipi_mode; INIT_LIST_HEAD(&isc->subdev_entities); mipi_mode = of_property_read_bool(np, "microchip,mipi-mode"); - while (1) { + for_each_endpoint_of_node(np, epn) { struct v4l2_fwnode_endpoint v4l2_epn = { .bus_type = 0 }; - epn = of_graph_get_next_endpoint(np, epn); - if (!epn) - return 0; - ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(epn), &v4l2_epn); if (ret) {