diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2018-04-14 07:56:58 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2018-04-20 09:32:43 -0400 |
commit | a31ffe939f0d1e425ddf7b8468efa6e6b746a0be (patch) | |
tree | 36eb7a722bd456883550bfb06c9516e6f7dbb874 /drivers/media/platform/rcar-vin/rcar-core.c | |
parent | d6ad012ebf274bef78dac09c206edc4b54998dd1 (diff) | |
download | op-kernel-dev-a31ffe939f0d1e425ddf7b8468efa6e6b746a0be.zip op-kernel-dev-a31ffe939f0d1e425ddf7b8468efa6e6b746a0be.tar.gz |
media: rcar-vin: unregister video device on driver removal
If the video device was registered by the complete() callback it should
be unregistered when a device is unbound from the driver. Protect from
printing an uninitialized video device node name by adding a check in
rvin_v4l2_unregister() to identify that the video device is registered.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/rcar-vin/rcar-core.c')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c index 2bedf20..47f06ac 100644 --- a/drivers/media/platform/rcar-vin/rcar-core.c +++ b/drivers/media/platform/rcar-vin/rcar-core.c @@ -272,6 +272,8 @@ static int rcar_vin_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); + rvin_v4l2_unregister(vin); + v4l2_async_notifier_unregister(&vin->notifier); v4l2_async_notifier_cleanup(&vin->notifier); |