Skip to content

Commit ada5caa

Browse files
morimotohdeller
authored andcommitted
fbdev: omap2: replace of_graph_get_next_endpoint()
From DT point of view, in general, drivers should be asking for a specific port number because their function is fixed in the binding. of_graph_get_next_endpoint() doesn't match to this concept. Simply replace - of_graph_get_next_endpoint(xxx, NULL); + of_graph_get_endpoint_by_regs(xxx, 0, -1); Link: https://lore.kernel.org/r/20240202174941.GA310089-robh@kernel.org Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 4cece76 commit ada5caa

File tree

7 files changed

+10
-27
lines changed

7 files changed

+10
-27
lines changed

drivers/video/fbdev/omap2/omapfb/dss/dsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/debugfs.h>
2929
#include <linux/pm_runtime.h>
3030
#include <linux/of.h>
31+
#include <linux/of_graph.h>
3132
#include <linux/of_platform.h>
3233
#include <linux/component.h>
3334

@@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev)
50795080
struct device_node *ep;
50805081
struct omap_dsi_pin_config pin_cfg;
50815082

5082-
ep = omapdss_of_get_first_endpoint(node);
5083+
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
50835084
if (!ep)
50845085
return 0;
50855086

drivers/video/fbdev/omap2/omapfb/dss/dss-of.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -130,32 +130,14 @@ static struct device_node *omapdss_of_get_remote_port(const struct device_node *
130130
return np;
131131
}
132132

133-
struct device_node *
134-
omapdss_of_get_first_endpoint(const struct device_node *parent)
135-
{
136-
struct device_node *port, *ep;
137-
138-
port = omapdss_of_get_next_port(parent, NULL);
139-
140-
if (!port)
141-
return NULL;
142-
143-
ep = omapdss_of_get_next_endpoint(port, NULL);
144-
145-
of_node_put(port);
146-
147-
return ep;
148-
}
149-
EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
150-
151133
struct omap_dss_device *
152134
omapdss_of_find_source_for_first_ep(struct device_node *node)
153135
{
154136
struct device_node *ep;
155137
struct device_node *src_port;
156138
struct omap_dss_device *src;
157139

158-
ep = omapdss_of_get_first_endpoint(node);
140+
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
159141
if (!ep)
160142
return ERR_PTR(-EINVAL);
161143

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/pm_runtime.h>
2121
#include <linux/clk.h>
2222
#include <linux/of.h>
23+
#include <linux/of_graph.h>
2324
#include <linux/regulator/consumer.h>
2425
#include <linux/component.h>
2526
#include <video/omapfb_dss.h>
@@ -529,7 +530,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
529530
struct device_node *ep;
530531
int r;
531532

532-
ep = omapdss_of_get_first_endpoint(node);
533+
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
533534
if (!ep)
534535
return 0;
535536

drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/pm_runtime.h>
2626
#include <linux/clk.h>
2727
#include <linux/of.h>
28+
#include <linux/of_graph.h>
2829
#include <linux/regulator/consumer.h>
2930
#include <linux/component.h>
3031
#include <video/omapfb_dss.h>
@@ -561,7 +562,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
561562
struct device_node *ep;
562563
int r;
563564

564-
ep = omapdss_of_get_first_endpoint(node);
565+
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
565566
if (!ep)
566567
return 0;
567568

drivers/video/fbdev/omap2/omapfb/dss/venc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/regulator/consumer.h>
2525
#include <linux/pm_runtime.h>
2626
#include <linux/of.h>
27+
#include <linux/of_graph.h>
2728
#include <linux/component.h>
2829

2930
#include <video/omapfb_dss.h>
@@ -764,7 +765,7 @@ static int venc_probe_of(struct platform_device *pdev)
764765
u32 channels;
765766
int r;
766767

767-
ep = omapdss_of_get_first_endpoint(node);
768+
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
768769
if (!ep)
769770
return 0;
770771

drivers/video/fbdev/pxafb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2171,7 +2171,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
21712171
u32 bus_width;
21722172
int ret, i;
21732173

2174-
np = of_graph_get_next_endpoint(dev->of_node, NULL);
2174+
np = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
21752175
if (!np) {
21762176
dev_err(dev, "could not find endpoint\n");
21772177
return -EINVAL;

include/video/omapfb_dss.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,9 +819,6 @@ struct device_node *
819819
omapdss_of_get_next_endpoint(const struct device_node *parent,
820820
struct device_node *prev);
821821

822-
struct device_node *
823-
omapdss_of_get_first_endpoint(const struct device_node *parent);
824-
825822
struct omap_dss_device *
826823
omapdss_of_find_source_for_first_ep(struct device_node *node);
827824
#else

0 commit comments

Comments
 (0)