Skip to content

Commit 95778c2

Browse files
pH5mchehab
authored andcommitted
media: video-mux: Skip dangling endpoints
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]>
1 parent 50e7a31 commit 95778c2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/media/platform/video-mux.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,14 +364,22 @@ static int video_mux_async_register(struct video_mux *vmux,
364364

365365
for (i = 0; i < num_input_pads; i++) {
366366
struct v4l2_async_subdev *asd;
367-
struct fwnode_handle *ep;
367+
struct fwnode_handle *ep, *remote_ep;
368368

369369
ep = fwnode_graph_get_endpoint_by_id(
370370
dev_fwnode(vmux->subdev.dev), i, 0,
371371
FWNODE_GRAPH_ENDPOINT_NEXT);
372372
if (!ep)
373373
continue;
374374

375+
/* Skip dangling endpoints for backwards compatibility */
376+
remote_ep = fwnode_graph_get_remote_endpoint(ep);
377+
if (!remote_ep) {
378+
fwnode_handle_put(ep);
379+
continue;
380+
}
381+
fwnode_handle_put(remote_ep);
382+
375383
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
376384
&vmux->notifier, ep, struct v4l2_async_subdev);
377385

0 commit comments

Comments
 (0)