This is an automatic generated email to let you know that the following patch 
were queued:

Subject: staging: media: atmel: use for_each_endpoint_of_node()
Author:  Kuninori Morimoto <kuninori.morimoto...@renesas.com>
Date:    Tue Jul 30 00:35:21 2024 +0000

We already have for_each_endpoint_of_node(), don't use
of_graph_get_next_endpoint() directly. Replace it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto...@renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+rene...@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 10 +++-------
 drivers/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) {

Reply via email to