Skip to content

Commit 60c05d9

Browse files
Sakari Ailusrkhuangtao
authored andcommitted
FROMLIST: v4l: async: Register sub-devices before calling bound callback
Register the sub-device before calling the notifier's bound callback. Doing this the other way around is problematic as the struct v4l2_device has not assigned for the sub-device yet and may be required by the bound callback. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> (cherry picked from commit b1ba01634a3779612c760136710fc1de1f671b23) https://git.linuxtv.org/sailus/media_tree.git/log/?h=010f7f4393fd http://www.spinics.net/lists/linux-media/msg122688.html Signed-off-by: Marc Herbert <marc.herbert@intel.com> BUG=b:64133998 TEST=media device topology shows subdevs registered successfully TEST=no camera regression Change-Id: I5e8a7257461e4e773e8ec29720175fb1fc557f29 Reviewed-on: https://chromium-review.googlesource.com/693691 Commit-Ready: Tomasz Figa <tfiga@chromium.org> Tested-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
1 parent 8c73730 commit 60c05d9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/media/v4l2-core/v4l2-async.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,
134134
{
135135
int ret;
136136

137-
ret = v4l2_async_notifier_call_bound(notifier, sd, asd);
137+
ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd);
138138
if (ret < 0)
139139
return ret;
140140

141-
ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd);
141+
ret = v4l2_async_notifier_call_bound(notifier, sd, asd);
142142
if (ret < 0) {
143-
v4l2_async_notifier_call_unbind(notifier, sd, asd);
143+
v4l2_device_unregister_subdev(sd);
144144
return ret;
145145
}
146146

0 commit comments

Comments
 (0)