Commit f3bc07eb authored by Alex Bee's avatar Alex Bee Committed by Robert Foss

drm: bridge: it66121: Fix return value it66121_probe

Currently it66121_probe returns -EPROBE_DEFER if the there is no remote
endpoint found in the device tree which doesn't seem helpful, since this
is not going to change later and it is never checked if the next bridge
has been initialized yet. It will fail in that case later while doing
drm_bridge_attach for the next bridge in it66121_bridge_attach.

Since the bindings documentation for it66121 bridge driver states
there has to be a remote endpoint defined, its safe to return -EINVAL
in that case.
This additonally adds a check, if the remote endpoint is enabled and
returns -EPROBE_DEFER, if the remote bridge hasn't been initialized
(yet).

Fixes: 988156dc ("drm: bridge: add it66121 driver")
Signed-off-by: default avatarAlex Bee <knaerzche@gmail.com>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210918140420.231346-1-knaerzche@gmail.com
parent 9fcb4a8f
...@@ -918,11 +918,23 @@ static int it66121_probe(struct i2c_client *client, ...@@ -918,11 +918,23 @@ static int it66121_probe(struct i2c_client *client,
return -EINVAL; return -EINVAL;
ep = of_graph_get_remote_node(dev->of_node, 1, -1); ep = of_graph_get_remote_node(dev->of_node, 1, -1);
if (!ep) if (!ep) {
return -EPROBE_DEFER; dev_err(ctx->dev, "The endpoint is unconnected\n");
return -EINVAL;
}
if (!of_device_is_available(ep)) {
of_node_put(ep);
dev_err(ctx->dev, "The remote device is disabled\n");
return -ENODEV;
}
ctx->next_bridge = of_drm_find_bridge(ep); ctx->next_bridge = of_drm_find_bridge(ep);
of_node_put(ep); of_node_put(ep);
if (!ctx->next_bridge) {
dev_dbg(ctx->dev, "Next bridge not found, deferring probe\n");
return -EPROBE_DEFER;
}
if (!ctx->next_bridge) if (!ctx->next_bridge)
return -EPROBE_DEFER; return -EPROBE_DEFER;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment