summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-async.c
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2017-11-15 10:43:58 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-11-30 04:44:07 -0500
commit487cc857851f6ca7850636bd111e7a4bfadab4da (patch)
tree9b036848e1ec3fc90dda8e945bfc8566d4049acb /drivers/media/v4l2-core/v4l2-async.c
parent3bf393860f6efc41ce268f5c21a457df1e8e6e00 (diff)
downloadlinux-487cc857851f6ca7850636bd111e7a4bfadab4da.tar.bz2
media: v4l: async: use the v4l2_dev from the root notifier when matching sub-devices
When matching and registering a sub-device from a sub-notifier use the v4l2_device from the root parent notifier. Using the v4l2_dev stored in the sub-notifier itself is incorrect as it might not be set. This can be demonstrated by unbinding and rebinding the adv748x driver and observing that it fails to probe due to the check !v4l2_dev in v4l2_device_register_subdev(). # echo 4-0070 > /sys/bus/i2c/drivers/adv748x/unbind # echo 4-0070 > /sys/bus/i2c/drivers/adv748x/bind adv748x 4-0070: chip found @ 0xe0 revision 2143 adv748x 4-0070: Failed to probe TXA adv748x: probe of 4-0070 failed with error -22 Looking at the commit which adds sub-notifiers to V4L2 it looks like this is the intended behavior of the original commit. With this fix the adv748x can be re-bound and still function properly. Fixes: 2cab00bb076b9f0e ("media: v4l: async: Allow binding notifiers to sub-devices") Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-async.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index a7c3464976f2..e5acfab470a5 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -558,8 +558,7 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
if (!asd)
continue;
- ret = v4l2_async_match_notify(notifier, notifier->v4l2_dev, sd,
- asd);
+ ret = v4l2_async_match_notify(notifier, v4l2_dev, sd, asd);
if (ret)
goto err_unbind;