Skip to content

Commit

Permalink
[wip] v4l: async: handle subdev notifier
Browse files Browse the repository at this point in the history
Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
  • Loading branch information
xlnx-hyunkwon committed Feb 20, 2020
1 parent 7fea513 commit 3bd2dde
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion drivers/media/v4l2-core/v4l2-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ v4l2_async_notifier_try_all_subdevs(struct v4l2_async_notifier *notifier)
struct v4l2_device *v4l2_dev =
v4l2_async_notifier_find_v4l2_dev(notifier);
struct v4l2_subdev *sd;
struct v4l2_async_notifier *parent;

if (!v4l2_dev)
return 0;
Expand All @@ -299,6 +300,24 @@ v4l2_async_notifier_try_all_subdevs(struct v4l2_async_notifier *notifier)
goto again;
}

parent = notifier;
while (parent->parent) {
parent = parent->parent;
list_for_each_entry(sd, &parent->done, async_list) {
struct v4l2_async_subdev *asd;
int ret;

asd = v4l2_async_find_match(notifier, sd);
if (!asd)
continue;

list_del(&asd->list);
ret = v4l2_async_notifier_call_bound(notifier, sd, asd);
if (ret < 0)
return ret;
}
}

return 0;
}

Expand Down Expand Up @@ -382,9 +401,12 @@ v4l2_async_notifier_has_async_subdev(struct v4l2_async_notifier *notifier,
}

/* Check that an asd does not exist in other notifiers. */
list_for_each_entry(notifier, &notifier_list, list)
list_for_each_entry(notifier, &notifier_list, list) {
if (!notifier->v4l2_dev)
continue;
if (__v4l2_async_notifier_has_async_subdev(notifier, asd))
return true;
}

return false;
}
Expand Down

0 comments on commit 3bd2dde

Please sign in to comment.