Skip to content

Commit a61f8a2

Browse files
pH5gregkh
authored andcommitted
media: video-mux: Skip dangling endpoints
[ Upstream commit 95778c2 ] 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 <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 612b385 ("media: video-mux: Create media links in bound notifier") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 62c6668 commit a61f8a2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎drivers/media/platform/video-mux.c‎

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

363363
for (i = 0; i < num_input_pads; i++) {
364364
struct v4l2_async_subdev *asd;
365-
struct fwnode_handle *ep;
365+
struct fwnode_handle *ep, *remote_ep;
366366

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

373+
/* Skip dangling endpoints for backwards compatibility */
374+
remote_ep = fwnode_graph_get_remote_endpoint(ep);
375+
if (!remote_ep) {
376+
fwnode_handle_put(ep);
377+
continue;
378+
}
379+
fwnode_handle_put(remote_ep);
380+
373381
asd = v4l2_async_notifier_add_fwnode_remote_subdev(
374382
&vmux->notifier, ep, sizeof(*asd));
375383

0 commit comments

Comments
 (0)