summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2016-03-13 06:57:40 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-31 20:50:39 +0300
commitffa8576a5380e098c4f066f50c5ec812b9abef43 (patch)
treed78a6bc42c703c6eb4d84618981f7f9534d83d23 /drivers/media
parent0fed3fcef48aff793f00aca44f366ff77fa95a01 (diff)
downloadlinux-ffa8576a5380e098c4f066f50c5ec812b9abef43.tar.xz
[media] media: au0828 fix to clear enable/disable/change source handlers
Fix to clear enable/disable/change source handlers in the media device when media device is unregistered in au0828_unregister_media_device(). When au0828 module is removed, snd-usb-audio shouldn't call the handlers. Clearing will ensure snd-usb-audio won't call them once au0828 is removed. [mchehab@osg.samsung.com: fix a compilation breakage] Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/usb/au0828/au0828-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index ecfa18939663..2fcd17d9b1a6 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -137,6 +137,11 @@ static void au0828_unregister_media_device(struct au0828_dev *dev)
#ifdef CONFIG_MEDIA_CONTROLLER
if (dev->media_dev &&
media_devnode_is_registered(&dev->media_dev->devnode)) {
+ /* clear enable_source, disable_source */
+ dev->media_dev->source_priv = NULL;
+ dev->media_dev->enable_source = NULL;
+ dev->media_dev->disable_source = NULL;
+
media_device_unregister(dev->media_dev);
media_device_cleanup(dev->media_dev);
dev->media_dev = NULL;