diff mbox series

[11/13] fbdev: omapfb: use of_graph_get_next_port()

Message ID 874jf4ud77.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State Handled Elsewhere
Headers show
Series of: property: add port base loop | expand

Commit Message

Kuninori Morimoto Jan. 23, 2024, 12:05 a.m. UTC
Now we can use of_graph_get_next_port() for port parsing.
Use it on omapfb.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 48 +------------------
 drivers/video/fbdev/omap2/omapfb/dss/dss.c    |  8 ++--
 include/video/omapfb_dss.h                    |  4 --
 3 files changed, 5 insertions(+), 55 deletions(-)

Comments

kernel test robot Jan. 27, 2024, 3:57 p.m. UTC | #1
Hi Kuninori,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-sound/for-next]
[also build test WARNING on linus/master v6.8-rc1 next-20240125]
[cannot apply to robh/for-next drm-misc/drm-misc-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kuninori-Morimoto/of-property-add-port-base-loop/20240123-081427
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
patch link:    https://lore.kernel.org/r/874jf4ud77.wl-kuninori.morimoto.gx%40renesas.com
patch subject: [PATCH 11/13] fbdev: omapfb: use of_graph_get_next_port()
config: i386-buildonly-randconfig-003-20240127 (https://download.01.org/0day-ci/archive/20240127/202401272336.CCkvpjde-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240127/202401272336.CCkvpjde-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202401272336.CCkvpjde-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/omap2/omapfb/dss/dss.c: In function 'dss_init_ports':
   drivers/video/fbdev/omap2/omapfb/dss/dss.c:925:9: error: implicit declaration of function 'of_graph_get_next_port'; did you mean 'of_get_next_parent'? [-Werror=implicit-function-declaration]
     port = of_graph_get_next_port(parent, NULL);
            ^~~~~~~~~~~~~~~~~~~~~~
            of_get_next_parent
>> drivers/video/fbdev/omap2/omapfb/dss/dss.c:925:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     port = of_graph_get_next_port(parent, NULL);
          ^
   drivers/video/fbdev/omap2/omapfb/dss/dss.c:956:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
       (port = of_graph_get_next_port(parent, port)) != NULL);
             ^
   drivers/video/fbdev/omap2/omapfb/dss/dss.c: In function 'dss_uninit_ports':
   drivers/video/fbdev/omap2/omapfb/dss/dss.c:972:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     port = of_graph_get_next_port(parent, NULL);
          ^
   drivers/video/fbdev/omap2/omapfb/dss/dss.c:1003:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     } while ((port = of_graph_get_next_port(parent, port)) != NULL);
                    ^
   cc1: some warnings being treated as errors


vim +925 drivers/video/fbdev/omap2/omapfb/dss/dss.c

   915	
   916	static int dss_init_ports(struct platform_device *pdev)
   917	{
   918		struct device_node *parent = pdev->dev.of_node;
   919		struct device_node *port;
   920		int r, ret = 0;
   921	
   922		if (parent == NULL)
   923			return 0;
   924	
 > 925		port = of_graph_get_next_port(parent, NULL);
   926		if (!port)
   927			return 0;
   928	
   929		if (dss.feat->num_ports == 0)
   930			return 0;
   931	
   932		do {
   933			enum omap_display_type port_type;
   934			u32 reg;
   935	
   936			r = of_property_read_u32(port, "reg", &reg);
   937			if (r)
   938				reg = 0;
   939	
   940			if (reg >= dss.feat->num_ports)
   941				continue;
   942	
   943			port_type = dss.feat->ports[reg];
   944	
   945			switch (port_type) {
   946			case OMAP_DISPLAY_TYPE_DPI:
   947				ret = dpi_init_port(pdev, port);
   948				break;
   949			case OMAP_DISPLAY_TYPE_SDI:
   950				ret = sdi_init_port(pdev, port);
   951				break;
   952			default:
   953				break;
   954			}
   955		} while (!ret &&
   956			 (port = of_graph_get_next_port(parent, port)) != NULL);
   957	
   958		if (ret)
   959			dss_uninit_ports(pdev);
   960	
   961		return ret;
   962	}
   963
diff mbox series

Patch

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
index fe6c72d03216..321ae18f2747 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss-of.c
@@ -15,52 +15,6 @@ 
 
 #include "dss.h"
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev)
-{
-	struct device_node *port = NULL;
-
-	if (!parent)
-		return NULL;
-
-	if (!prev) {
-		struct device_node *ports;
-		/*
-		 * It's the first call, we have to find a port subnode
-		 * within this node or within an optional 'ports' node.
-		 */
-		ports = of_get_child_by_name(parent, "ports");
-		if (ports)
-			parent = ports;
-
-		port = of_get_child_by_name(parent, "port");
-
-		/* release the 'ports' node */
-		of_node_put(ports);
-	} else {
-		struct device_node *ports;
-
-		ports = of_get_parent(prev);
-		if (!ports)
-			return NULL;
-
-		do {
-			port = of_get_next_child(ports, prev);
-			if (!port) {
-				of_node_put(ports);
-				return NULL;
-			}
-			prev = port;
-		} while (!of_node_name_eq(port, "port"));
-
-		of_node_put(ports);
-	}
-
-	return port;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_port);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev)
@@ -122,7 +76,7 @@  omapdss_of_get_first_endpoint(const struct device_node *parent)
 {
 	struct device_node *port, *ep;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 
 	if (!port)
 		return NULL;
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
index d814e4baa4b3..cbcc10af29b6 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
@@ -922,7 +922,7 @@  static int dss_init_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return 0;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return 0;
 
@@ -953,7 +953,7 @@  static int dss_init_ports(struct platform_device *pdev)
 			break;
 		}
 	} while (!ret &&
-		 (port = omapdss_of_get_next_port(parent, port)) != NULL);
+		 (port = of_graph_get_next_port(parent, port)) != NULL);
 
 	if (ret)
 		dss_uninit_ports(pdev);
@@ -969,7 +969,7 @@  static void dss_uninit_ports(struct platform_device *pdev)
 	if (parent == NULL)
 		return;
 
-	port = omapdss_of_get_next_port(parent, NULL);
+	port = of_graph_get_next_port(parent, NULL);
 	if (!port)
 		return;
 
@@ -1000,7 +1000,7 @@  static void dss_uninit_ports(struct platform_device *pdev)
 		default:
 			break;
 		}
-	} while ((port = omapdss_of_get_next_port(parent, port)) != NULL);
+	} while ((port = of_graph_get_next_port(parent, port)) != NULL);
 }
 
 static int dss_video_pll_probe(struct platform_device *pdev)
diff --git a/include/video/omapfb_dss.h b/include/video/omapfb_dss.h
index e8eaac2cb7b8..426d12881132 100644
--- a/include/video/omapfb_dss.h
+++ b/include/video/omapfb_dss.h
@@ -811,10 +811,6 @@  static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
 	return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
 }
 
-struct device_node *
-omapdss_of_get_next_port(const struct device_node *parent,
-			 struct device_node *prev);
-
 struct device_node *
 omapdss_of_get_next_endpoint(const struct device_node *parent,
 			     struct device_node *prev);