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>
This commit is contained in:
parent
4cece76496
commit
ada5caa4e0
@ -28,6 +28,7 @@
|
|||||||
#include <linux/debugfs.h>
|
#include <linux/debugfs.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_graph.h>
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
|
|
||||||
@ -5079,7 +5080,7 @@ static int dsi_probe_of(struct platform_device *pdev)
|
|||||||
struct device_node *ep;
|
struct device_node *ep;
|
||||||
struct omap_dsi_pin_config pin_cfg;
|
struct omap_dsi_pin_config pin_cfg;
|
||||||
|
|
||||||
ep = omapdss_of_get_first_endpoint(node);
|
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -130,24 +130,6 @@ static struct device_node *omapdss_of_get_remote_port(const struct device_node *
|
|||||||
return np;
|
return np;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct device_node *
|
|
||||||
omapdss_of_get_first_endpoint(const struct device_node *parent)
|
|
||||||
{
|
|
||||||
struct device_node *port, *ep;
|
|
||||||
|
|
||||||
port = omapdss_of_get_next_port(parent, NULL);
|
|
||||||
|
|
||||||
if (!port)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
ep = omapdss_of_get_next_endpoint(port, NULL);
|
|
||||||
|
|
||||||
of_node_put(port);
|
|
||||||
|
|
||||||
return ep;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(omapdss_of_get_first_endpoint);
|
|
||||||
|
|
||||||
struct omap_dss_device *
|
struct omap_dss_device *
|
||||||
omapdss_of_find_source_for_first_ep(struct device_node *node)
|
omapdss_of_find_source_for_first_ep(struct device_node *node)
|
||||||
{
|
{
|
||||||
@ -155,7 +137,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
|
|||||||
struct device_node *src_port;
|
struct device_node *src_port;
|
||||||
struct omap_dss_device *src;
|
struct omap_dss_device *src;
|
||||||
|
|
||||||
ep = omapdss_of_get_first_endpoint(node);
|
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_graph.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
#include <video/omapfb_dss.h>
|
#include <video/omapfb_dss.h>
|
||||||
@ -529,7 +530,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
|
|||||||
struct device_node *ep;
|
struct device_node *ep;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
ep = omapdss_of_get_first_endpoint(node);
|
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_graph.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
#include <video/omapfb_dss.h>
|
#include <video/omapfb_dss.h>
|
||||||
@ -561,7 +562,7 @@ static int hdmi_probe_of(struct platform_device *pdev)
|
|||||||
struct device_node *ep;
|
struct device_node *ep;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
ep = omapdss_of_get_first_endpoint(node);
|
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_graph.h>
|
||||||
#include <linux/component.h>
|
#include <linux/component.h>
|
||||||
|
|
||||||
#include <video/omapfb_dss.h>
|
#include <video/omapfb_dss.h>
|
||||||
@ -764,7 +765,7 @@ static int venc_probe_of(struct platform_device *pdev)
|
|||||||
u32 channels;
|
u32 channels;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
ep = omapdss_of_get_first_endpoint(node);
|
ep = of_graph_get_endpoint_by_regs(node, 0, -1);
|
||||||
if (!ep)
|
if (!ep)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -2171,7 +2171,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
|
|||||||
u32 bus_width;
|
u32 bus_width;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
np = of_graph_get_next_endpoint(dev->of_node, NULL);
|
np = of_graph_get_endpoint_by_regs(dev->of_node, 0, -1);
|
||||||
if (!np) {
|
if (!np) {
|
||||||
dev_err(dev, "could not find endpoint\n");
|
dev_err(dev, "could not find endpoint\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -819,9 +819,6 @@ struct device_node *
|
|||||||
omapdss_of_get_next_endpoint(const struct device_node *parent,
|
omapdss_of_get_next_endpoint(const struct device_node *parent,
|
||||||
struct device_node *prev);
|
struct device_node *prev);
|
||||||
|
|
||||||
struct device_node *
|
|
||||||
omapdss_of_get_first_endpoint(const struct device_node *parent);
|
|
||||||
|
|
||||||
struct omap_dss_device *
|
struct omap_dss_device *
|
||||||
omapdss_of_find_source_for_first_ep(struct device_node *node);
|
omapdss_of_find_source_for_first_ep(struct device_node *node);
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user