From: Daniel Scally Date: Thu, 7 Jan 2021 13:28:35 +0000 (+0100) Subject: media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in match_fwnode() X-Git-Tag: v5.15~1736^2~165 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06c85233121fabc69ffe6124953cd5304dbf3afd;p=platform%2Fkernel%2Flinux-starfive.git media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in match_fwnode() Where the fwnode graph is comprised of software_nodes, these will be assigned as the secondary to dev->fwnode. Check the v4l2_subdev's fwnode for a secondary and attempt to match against it during match_fwnode() to accommodate that possibility. Reviewed-by: Andy Shevchenko Reviewed-by: Laurent Pinchart Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c index e3ab003..9dd896d 100644 --- a/drivers/media/v4l2-core/v4l2-async.c +++ b/drivers/media/v4l2-core/v4l2-async.c @@ -88,6 +88,14 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier, return true; /* + * Check the same situation for any possible secondary assigned to the + * subdev's fwnode + */ + if (!IS_ERR_OR_NULL(sd->fwnode->secondary) && + sd->fwnode->secondary == asd->match.fwnode) + return true; + + /* * Otherwise, check if the sd fwnode and the asd fwnode refer to an * endpoint or a device. If they're of the same type, there's no match. * Technically speaking this checks if the nodes refer to a connected