drm: convert drivers to use drm_of_find_panel_or_bridge
Similar to the previous commit, convert drivers open coding OF graph parsing to use drm_of_find_panel_or_bridge instead. This changes some error messages to debug messages (in the graph core). Graph connections are often "no connects" depending on the particular board, so we want to avoid spurious messages. Plus the kernel is not a DT validator. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Archit Taneja <architt@codeaurora.org> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> [seanpaul dropped rockchip changes since they're now obsolete] Signed-off-by: Sean Paul <seanpaul@chromium.org>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <drm/drmP.h>
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
#include <drm/drm_of.h>
|
||||
#include <drm/drm_panel.h>
|
||||
|
||||
#include <drm/bridge/analogix_dp.h>
|
||||
@@ -211,8 +212,11 @@ static const struct component_ops exynos_dp_ops = {
|
||||
static int exynos_dp_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
struct device_node *np = NULL, *endpoint = NULL;
|
||||
struct device_node *np;
|
||||
struct exynos_dp_device *dp;
|
||||
struct drm_panel *panel;
|
||||
struct drm_bridge *bridge;
|
||||
int ret;
|
||||
|
||||
dp = devm_kzalloc(&pdev->dev, sizeof(struct exynos_dp_device),
|
||||
GFP_KERNEL);
|
||||
@@ -236,28 +240,13 @@ static int exynos_dp_probe(struct platform_device *pdev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
endpoint = of_graph_get_next_endpoint(dev->of_node, NULL);
|
||||
if (endpoint) {
|
||||
np = of_graph_get_remote_port_parent(endpoint);
|
||||
if (np) {
|
||||
/* The remote port can be either a panel or a bridge */
|
||||
dp->plat_data.panel = of_drm_find_panel(np);
|
||||
if (!dp->plat_data.panel) {
|
||||
dp->ptn_bridge = of_drm_find_bridge(np);
|
||||
if (!dp->ptn_bridge) {
|
||||
of_node_put(np);
|
||||
return -EPROBE_DEFER;
|
||||
}
|
||||
}
|
||||
of_node_put(np);
|
||||
} else {
|
||||
DRM_ERROR("no remote endpoint device node found.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
DRM_ERROR("no port endpoint subnode found.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, &panel, &bridge);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* The remote port can be either a panel or a bridge */
|
||||
dp->plat_data.panel = panel;
|
||||
dp->ptn_bridge = bridge;
|
||||
|
||||
out:
|
||||
return component_add(&pdev->dev, &exynos_dp_ops);
|
||||
|
Reference in New Issue
Block a user