mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
UPSTREAM: drm: convert drivers to use of_graph_get_remote_node
Convert drivers to use the new of_graph_get_remote_node() helper
instead of parsing the endpoint node and then getting the remote device
node. Now drivers can just specify the device node and which
port/endpoint and get back the connected remote device node. The details
of the graph binding are nicely abstracted into the core OF graph code.
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>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Liviu Dudau <liviu.dudau@arm.com>
Tested-by: Eric Anholt <eric@anholt.net>
Tested-by: Jyri Sarha <jsarha@ti.com>
Tested by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 86418f90a4)
Conflicts:
Only merge the file of drivers/gpu/drm/bridge/dumb-vga-dac.c
Change-Id: Ie8fd230f6d150ac8585e0b5418cbbca240b1d2f6
Signed-off-by: Jerry Xu <xbl@rock-chips.com>
This commit is contained in:
@@ -154,21 +154,12 @@ static const struct drm_bridge_funcs dumb_vga_bridge_funcs = {
|
||||
|
||||
static struct i2c_adapter *dumb_vga_retrieve_ddc(struct device *dev)
|
||||
{
|
||||
struct device_node *end_node, *phandle, *remote;
|
||||
struct device_node *phandle, *remote;
|
||||
struct i2c_adapter *ddc;
|
||||
|
||||
end_node = of_graph_get_endpoint_by_regs(dev->of_node, 1, -1);
|
||||
if (!end_node) {
|
||||
dev_err(dev, "Missing connector endpoint\n");
|
||||
return ERR_PTR(-ENODEV);
|
||||
}
|
||||
|
||||
remote = of_graph_get_remote_port_parent(end_node);
|
||||
of_node_put(end_node);
|
||||
if (!remote) {
|
||||
dev_err(dev, "Enable to parse remote node\n");
|
||||
remote = of_graph_get_remote_node(dev->of_node, 1, -1);
|
||||
if (!remote)
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
phandle = of_parse_phandle(remote, "ddc-i2c-bus", 0);
|
||||
of_node_put(remote);
|
||||
|
||||
Reference in New Issue
Block a user