Skip to content

Commit

Permalink
media: staging/imx: Loop through all registered subdevs for media links
Browse files Browse the repository at this point in the history
The root imx-media notifier no longer sees all bound subdevices because
some of them will be bound to subdev notifiers. So imx_media_create_links()
now needs to loop through all subdevices registered with the v4l2-device,
not just the ones in the root notifier's done list. This should be safe
because imx_media_create_of_links() checks if a fwnode link already
exists before creating.

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Steve Longerbeam authored and Mauro Carvalho Chehab committed Oct 4, 2018
1 parent 2171178 commit 1488c3c
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions drivers/staging/media/imx/imx-media-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static int imx_media_subdev_bound(struct v4l2_async_notifier *notifier,
}

/*
* create the media links for all subdevs that registered async.
* Create the media links for all subdevs that registered.
* Called after all async subdevs have bound.
*/
static int imx_media_create_links(struct v4l2_async_notifier *notifier)
Expand All @@ -184,14 +184,7 @@ static int imx_media_create_links(struct v4l2_async_notifier *notifier)
struct v4l2_subdev *sd;
int ret;

/*
* Only links are created between subdevices that are known
* to the async notifier. If there are other non-async subdevices,
* they were created internally by some subdevice (smiapp is one
* example). In those cases it is expected the subdevice is
* responsible for creating those internal links.
*/
list_for_each_entry(sd, &notifier->done, async_list) {
list_for_each_entry(sd, &imxmd->v4l2_dev.subdevs, list) {
switch (sd->grp_id) {
case IMX_MEDIA_GRP_ID_VDIC:
case IMX_MEDIA_GRP_ID_IC_PRP:
Expand All @@ -211,7 +204,10 @@ static int imx_media_create_links(struct v4l2_async_notifier *notifier)
imx_media_create_csi_of_links(imxmd, sd);
break;
default:
/* this is an external fwnode subdev */
/*
* if this subdev has fwnode links, create media
* links for them.
*/
imx_media_create_of_links(imxmd, sd);
break;
}
Expand Down

0 comments on commit 1488c3c

Please sign in to comment.