From patchwork Mon Jul 1 02:33:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13717502 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010040.outbound.protection.outlook.com [52.101.229.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 D4982C144 for ; Mon, 1 Jul 2024 02:33:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719801186; cv=fail; b=dVgR/Ly2i9wHpvah7NMnYYSnxZFCbghD1rv5NPBc0sn21LRLtbLbNSJPzW28mkyUdxVL8iBQ1zxvJPeSWIQpsO/bELa2ibOx95N97g00sdOQq64pgl4biXI9oQB0RTWY2aOz4f//dBAiHoDm/ZfUKNbASDsmkX7uTuvy7hiXUNU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719801186; c=relaxed/simple; bh=BdnZXUfuXUf5qLwS8rvuNqFCgjIGH5e1g1U3vc/YJWo=; h=Message-ID:From:Subject:To:In-Reply-To:References:Content-Type: Date:MIME-Version; b=JXOi0ZwtcAh91AzWlmx1N7dMANHktH8LXOwNhf72hPUrLrzVvvqk2awQtI59RlBrlLi3jiE/GbBHoZIOr3mGg9ZTGEA3zXzTpDkduKtAPDjxm9g0cQ8VaMmsZM/UyP85F966vsEQjg6/piKZkx1EkNZSK7Hu3k7qiiZbsJDiqb4= 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=mmO0EgDR; arc=fail smtp.client-ip=52.101.229.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="mmO0EgDR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HTC/3HPdk8zIT2LRv24y/0cIsr6Ph6rdKYsKosdHDN+FqBhk6sV1TEiGZY9KbsTDEzepjYaiyPlCuOLUV6sQ1gbrrweYKp/rZJnp8LPgh6OzbMCvpNrjz5IuavBFvjoGF5/lzGT+8kFU+qbC2RN1cxm5XiHpn2pE8zMz/z4hAjmnXuCNJ+mymN3gpV7GB+fuHb/1JceCi91CeEbypi05c8/4m0mRfFYByMvH3vIjCI9UkM8dgJsQ/UtX7BkcxEYfhOrMlNBfTbJM9c0L63FjIZA7YZQZqCkHctxiDv3QqRFcJ6sYMv/WVLfuxiJtlJLp9H5zr0D1Y8jGOA6VJwAR4A== 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=aYlWh8XuVZYCFYjBwCC4koBvO8Vel+UdsPWmd3H5cvw=; b=h4eXc5Zm5HL26tyq2rUzy4nDZkGDCqhYJr3OAdKBdFn7/+um0+aHWCl4cyWe7uNm8uzFv0HaX0TqY4Bfm0A7f6Ke9JnP97/civctw2o4UzaKLK739XxS0DU+8N/Obp49ov+RfnDJ0jN0j/s+8/P2a3JB8kNDPhm26AI/IWpG/uKgbNPAyuFWq3S/oGPVm5+4RIxCccZHoK55V7z3bcAX4qQtpbsWeOt5YjEd4YMAWVqLotGAb2i6ZtHqieHbMR/rom3sNIMPQ0lhSBL4Sh78Gv++HqJsYdpRKdZkUsUj/xrZqqPKuF7nkjtHUeIfWsSx4qkLL3EUGgYbCy2hJ6XOVA== 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=aYlWh8XuVZYCFYjBwCC4koBvO8Vel+UdsPWmd3H5cvw=; b=mmO0EgDRv5NkjtO1CgpL6xhJ9QU2Cwl2dHOZAI/1AkRthy2yV2PPoHOCat8nL2hbYYjpvocj30Cfye1psoDFU/+FDwSUfm/Es6ELWBhQx8x9bfyZ1m7pdbmdkzv+sO1DQfWgjAHK691YL2e8gJENxEJn8H1feW5qMEabxoPxNAQ= 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 TYCPR01MB9627.jpnprd01.prod.outlook.com (2603:1096:400:193::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Mon, 1 Jul 2024 02:33:02 +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.7719.029; Mon, 1 Jul 2024 02:33:02 +0000 Message-ID: <8734ot96zm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v5 7/7] staging: media: atmel: use for_each_endpoint_of_node() To: "Lad, Prabhakar" , Alexander Shishkin , Alexandre Belloni , Alexey Brodkin , Claudiu Beznea , Daniel Vetter , David Airlie , Dmitry Baryshkov , Eugen Hristev , Florian Fainelli , Greg Kroah-Hartman , Laurent Pinchart , Maarten Lankhorst , Mauro Carvalho Chehab , Maxime Ripard , Michal Simek , Neil Armstrong , Nicolas Ferre , Suzuki K Poulose , Thomas Zimmermann , Tomi Valkeinen , coresight@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-staging@lists.linux.dev In-Reply-To: <87cynx971l.wl-kuninori.morimoto.gx@renesas.com> References: <87cynx971l.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 1 Jul 2024 02:33:01 +0000 X-ClientProxiedBy: TYCP286CA0273.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::12) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9627:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f3c7cc2-c06e-4188-fbf9-08dc9976211f 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:13230040|7416014|376014|52116014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: pNLFiJvCXBXpjqm17PW8aY2twQKL3xwh0GhcYANJn12IrHYPrgn8yq0wEXkduyTz1lK0W5+PO3pCfz5ZGsxx3e11HWKEWIrWDLVlYEAG+8sG7gFEPMIqfLkG88GZvxid0ORBgbuHrawzc/Ug06b4MYrAONEiYnYDujgm2ZUjhHy6/zG1Dr+9r6Dfx+VnueF1McA3R1P7RLyd9bYVO0kuye2RE/7GV1y4er5U1vOwzsXRZjJj1Flfa54eO/8JjhbQeLUuk5EfQFiDQKZA12pPn23EJs3m9CgS5f1sJ84kTgs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z6sIZU84Iiy1qrhQLnGP2Nqo/wHkRSN+Wlq1CERSUSaSBBVAeb/UoEQ11ib0Yws2To= 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)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6Vshg3wpGVocDqn1lc8e55k/yIxnkA4rYKKwP4uHl7luu2D0QwbQ9keAsA3rDpPw61fNf7t/1EWfcKnXGpHPHKIlHo3UFL9Zfs7RxB8wXU4B8pidYOfa6HHjHx/IsdP+QPQ2er/bnO0DJ4CoEnGBcyFqkjnqj2AhNGIift0ZFOU9yHCIZjHKdL+er9jVdsQOcQ1XvR5H7QD8ZgSrMVE6AhdpjEluPIXPn/z2gqFvcyKvv5Fq9DDJxeLwmLdbfWCg2MzJQWSKGEShwYamvDBXYMajt5Hp3S/ZWxm6MvQ326Ec/q5nBDBhfWQBEgospbCtC7g0qYhsiS3k9Mjz7TYl5asGfFYNXRuFTGPXVB4BLMHYlfFhtQi1mNa2MIPPL8BQxM79qxXiXxsG7fOScLl6wHg3OEVFHjcseq5DNEwZhaIaqTDygaPqLu/mhMAJtHmqw3JZb3j+Hy/R3x7ADnbPxymUy8CKSXh4Asp0fKpHu4iruso15nmg7PWPBMkLAWo7800BaBjdhF4Tdg+/3DmNBAqCmoso3WCPzH5TUbmWoX2Py2lYite7+WTTW7c2n3nC00rnHzQac7wyZl8ij+ocYuTJfqCNQ5uy31xIbgIfATZRvGQ882EqZ2LF0WCXbjArZ9kC5KLI3aNHaM3FbXqQg6zoLKYHy9ABonId6yVvu31349lJt5OMX5n/QYkQWIQd/VDea+6j2pu/swrB9qMP7//y0nAxTzWk3PxVHdZ8TI4sZAyd+mVmkSQd0lgQVodJUPKgKY0xDzSCL27AyVBO3WcL5CWmFCZPKiceTUWYKLaxds72VixjrDo6R0rlYsnxPp8DlYj/2mkqPgVi4A690j+P59nqwudOsLr0r/43Q61gwtuCM+MIXvS7kaOempNETre/xNtfcM1nsJ7jQyLO2k1mRfMbFBeil1nVipp++vV0GLItogqH3Cqq/tz0VqK/stvWKw8Fz0PDFZZ5GwxvfctUDHYy2iWO7/xaw++ThZYwrd5FjsjY1B9ZnVxaDQNRS/FMwzNC5NmnJysH1xJ3FQygOXCOvTm1Ar8OAkiM6jk8awPcHD5HMTY+w7MfN10chLsotkvYil8ZD6Vku6SfSqK56UTQ/ulOfxhW7Gs9zQdwlAEb++VqlUXm2uX9mPiPS/52K2eIEXJwm2ad3Rz61xfVlu+WBmZjMHOyIF0c6EpXInDAtwP8qvvGa6n+hYoSaIfyepHtLx/dxrbnb1ryLnDoiO2Wl2MNH7g87itLhyEgY2nYSAj1TW9EfktQrQkpdncqg0fAdVtGSn9EHQ2PE37WQHIZRaK2jIRDW5pWSnPeLqtzUfyrrb8zZER1POourzXMBHZrZmAmeTBsQE/5PQCms7QDLw/7me+ixAK/fsfXskbkyAv3TblEKpKcoAgGgBJrqkUR2YU+kzW2MEks7pcemk5HysNyHW6b+Z8ZqlTCvufhb9G2QAvToCTemFHrJ+kq2PzdkHfnBradgS2B30LlfMjDA3+PIajUT3P9smPDpvSZznDJGFrXTZyLjSTt3gLLCDYh2Cab0c6azrYBLgHzTOzE7WeYx9hFJZVSEpC4Y5kAfwkQRK/E6L3DdJxx/+BSayhqBeL7kTN3MsNooDQGCYnJ39iDwRE2rC3qQF0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f3c7cc2-c06e-4188-fbf9-08dc9976211f X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2024 02:33:02.1639 (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: tlD9pWhWIDxlG85C4uL7eazSC1qwRvXnWfnPhPQ7CPwfDkH3qNtgqAoMUYGzV/mgOPhAt4F22RFA6tA/0MX4kyN9/mdFO6cJveywJKi1G0NYcF85XSb6+w/AuZuPalfO X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9627 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 31b2b48085c5..712f916f0935 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 020034f631f5..9485167d5b7d 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) {