Skip to content

Commit

Permalink
media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in match_fw…
Browse files Browse the repository at this point in the history
…node()

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 <andriy.shevchenko@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Daniel Scally authored and Mauro Carvalho Chehab committed Jan 26, 2021
1 parent acec1ff commit 06c8523
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/media/v4l2-core/v4l2-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier,
if (sd->fwnode == asd->match.fwnode)
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.
Expand Down

0 comments on commit 06c8523

Please sign in to comment.