From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795044810; b=LDjHuCp86JykZAvUPx6SPWxFKDsdaTAjq1XZRGszOF0lq1o/dn3xtEz5k8pGxKCAwHbo MJL15180DpLJOA+dcXhQkYIPAs2NBex9zT/5DIWXFIw/n9WR00fMsE1LN9JNY8leQ3Tur XvOCUCP5I7f/fKSIaMqPBZYWfFaETsyFjP60vMb5IIw0bd1Tj41Uw2NVRbGOM6XOzQn8l OZ6oIjwR2bzdrSHdjHgCJ4cUdFjsdKGGL+WotP8J+XKKLtnU6FP8U4C/wRQD++CfEcgYr V5DkjAw4+ngSQaGR+VX7yyJyKv5aIPMe7L80bjVRQpm9tbdZ8YxwD+urEQVxPCdT3Ow== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795044810; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=51OjUH2bRswEJ/6GLSz84akZKtxRSDyCTs6uu/e5rXo=; b=V6bXp7iQce0XdL5sQ7CDHJtOr4KZmMO0mr+JENndv+HsY4BSG42PjhAS/b7PERNQ6NCV LKPzSNuwQzpkKMU1jWjO0oms+sgR8ZEnTd3K7yi+6fFBS0rmnXu9dDEs4X3lYluqtBrGz p2goZTCF2/KfzMWXD/T/qdglIqy0nzrcHIFHFCb+SANd4ypo29deihWkSh6ddumorjaC5 n3eW7C8EwjQ2IVNG6dgs+WyIktjqcNLkL19gF0UXWaE1YWZSh3EUI1oKvVvoE/djb+XIj tdBRERhgrQ2xzMz6cButEnizI/ROYNPWlRIpLzaqTWhLxUF2g5q9zdykqWmMXX/309w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=t4ZNGg6U; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 71AA260A382C; Wed, 18 Nov 2026 23:33:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=t4ZNGg6U Received: by smtp.kernel.org (Postfix) with ESMTPSA id C768A1F000C7; Wed, 18 Nov 2026 23:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795044810; bh=51OjUH2bRswEJ/6GLSz84akZKtxRSDyCTs6uu/e5rXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=t4ZNGg6UrZTeJqJrMNEyjhycHgiYiSNLJwwqh2tI52pK7KsMmtGwo3V8+6cjMmKty CxLqf7sZHaq3QoVovRUVOg+xiRr/cEcwz38kticgdFTUCnH9Us8MDdv+ZTilE4p7Xt iFmJrKg2skEqpmpigPv2LjCS3U958nP6bQTdMhRw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kuninori Morimoto , Laurent Pinchart , Hans Verkuil , Sasha Levin Subject: [PATCH 6.1 0700/2857] media: platform: microchip: use for_each_endpoint_of_node() Date: Wed, 18 Nov 2026 15:28:54 +0100 Message-ID: <20261118150226.761459443@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kuninori Morimoto [ Upstream commit 68a1560c3b7f8bb23423b272334fc19279e82d9a ] 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 Signed-off-by: Hans Verkuil Stable-dep-of: f2eb2fd388bf ("media: microchip-isc: take a reference on the parsed endpoints") Signed-off-by: Sasha Levin --- .../media/platform/atmel/atmel-sama5d2-isc.c | 21 +++++++------------ .../media/platform/atmel/atmel-sama7g5-isc.c | 21 +++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c index 9881d89a645b0..7689bc2bff481 100644 --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c @@ -333,33 +333,29 @@ 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; 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; + int ret; ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(epn), &v4l2_epn); if (ret) { - ret = -EINVAL; + of_node_put(epn); dev_err(dev, "Could not parse the endpoint\n"); - break; + return -EINVAL; } subdev_entity = devm_kzalloc(dev, sizeof(*subdev_entity), GFP_KERNEL); if (!subdev_entity) { - ret = -ENOMEM; - break; + of_node_put(epn); + return -ENOMEM; } subdev_entity->epn = epn; @@ -380,9 +376,8 @@ static int isc_parse_dt(struct device *dev, struct isc_device *isc) list_add_tail(&subdev_entity->list, &isc->subdev_entities); } - of_node_put(epn); - return ret; + return 0; } static int atmel_isc_probe(struct platform_device *pdev) diff --git a/drivers/media/platform/atmel/atmel-sama7g5-isc.c b/drivers/media/platform/atmel/atmel-sama7g5-isc.c index 8b11aa8340d7e..ef0c3c357426f 100644 --- a/drivers/media/platform/atmel/atmel-sama7g5-isc.c +++ b/drivers/media/platform/atmel/atmel-sama7g5-isc.c @@ -316,36 +316,32 @@ 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; 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; + int ret; ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(epn), &v4l2_epn); if (ret) { - ret = -EINVAL; + of_node_put(epn); dev_err(dev, "Could not parse the endpoint\n"); - break; + return -EINVAL; } subdev_entity = devm_kzalloc(dev, sizeof(*subdev_entity), GFP_KERNEL); if (!subdev_entity) { - ret = -ENOMEM; - break; + of_node_put(epn); + return -ENOMEM; } subdev_entity->epn = epn; @@ -369,9 +365,8 @@ static int xisc_parse_dt(struct device *dev, struct isc_device *isc) list_add_tail(&subdev_entity->list, &isc->subdev_entities); } - of_node_put(epn); - return ret; + return 0; } static int microchip_xisc_probe(struct platform_device *pdev) -- 2.53.0