@@ -20,6 +20,7 @@
#include <linux/regulator/consumer.h>
#include <linux/string.h>
#include <linux/of.h>
+#include <linux/of_graph.h>
#include <linux/clk.h>
#include <linux/component.h>
@@ -845,7 +846,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port)
if (!dpi)
return -ENOMEM;
- ep = omapdss_of_get_next_endpoint(port, NULL);
+ ep = of_graph_get_next_endpoint(port, NULL);
if (!ep)
return 0;
@@ -15,26 +15,6 @@
#include "dss.h"
-struct device_node *
-omapdss_of_get_next_endpoint(const struct device_node *parent,
- struct device_node *prev)
-{
- struct device_node *ep = NULL;
-
- if (!parent)
- return NULL;
-
- do {
- ep = of_get_next_child(parent, prev);
- if (!ep)
- return NULL;
- prev = ep;
- } while (!of_node_name_eq(ep, "endpoint"));
-
- return ep;
-}
-EXPORT_SYMBOL_GPL(omapdss_of_get_next_endpoint);
-
struct device_node *dss_of_port_get_parent_device(struct device_node *port)
{
struct device_node *np;
@@ -81,7 +61,7 @@ omapdss_of_get_first_endpoint(const struct device_node *parent)
if (!port)
return NULL;
- ep = omapdss_of_get_next_endpoint(port, NULL);
+ ep = of_graph_get_next_endpoint(port, NULL);
of_node_put(port);
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/string.h>
#include <linux/of.h>
+#include <linux/of_graph.h>
#include <linux/component.h>
#include <video/omapfb_dss.h>
@@ -405,7 +406,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port)
u32 datapairs;
int r;
- ep = omapdss_of_get_next_endpoint(port, NULL);
+ ep = of_graph_get_next_endpoint(port, NULL);
if (!ep)
return 0;
@@ -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_endpoint(const struct device_node *parent,
- struct device_node *prev);
-
struct device_node *
omapdss_of_get_first_endpoint(const struct device_node *parent);
We can now use of_graph_get_next_endpoint(), let's use it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- drivers/video/fbdev/omap2/omapfb/dss/dpi.c | 3 ++- drivers/video/fbdev/omap2/omapfb/dss/dss-of.c | 22 +------------------ drivers/video/fbdev/omap2/omapfb/dss/sdi.c | 3 ++- include/video/omapfb_dss.h | 4 ---- 4 files changed, 5 insertions(+), 27 deletions(-)