Skip to content

Commit

Permalink
media: video-mux: Skip dangling endpoints
Browse files Browse the repository at this point in the history
i.MX6 device tree include files contain dangling endpoints for the
board device tree writers' convenience. These are still included in
many existing device trees.
Treat dangling endpoints as non-existent to support them.

Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Fixes: 612b385 ("media: video-mux: Create media links in bound notifier")
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pH5 authored and mchehab committed Jun 28, 2021
1 parent 50e7a31 commit 95778c2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion drivers/media/platform/video-mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,22 @@ static int video_mux_async_register(struct video_mux *vmux,

for (i = 0; i < num_input_pads; i++) {
struct v4l2_async_subdev *asd;
struct fwnode_handle *ep;
struct fwnode_handle *ep, *remote_ep;

ep = fwnode_graph_get_endpoint_by_id(
dev_fwnode(vmux->subdev.dev), i, 0,
FWNODE_GRAPH_ENDPOINT_NEXT);
if (!ep)
continue;

/* Skip dangling endpoints for backwards compatibility */
remote_ep = fwnode_graph_get_remote_endpoint(ep);
if (!remote_ep) {
fwnode_handle_put(ep);
continue;
}
fwnode_handle_put(remote_ep);

asd = v4l2_async_notifier_add_fwnode_remote_subdev(
&vmux->notifier, ep, struct v4l2_async_subdev);

Expand Down

0 comments on commit 95778c2

Please sign in to comment.