Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1356606
| From | Shuah Khan <shuahkh@osg.samsung.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] media: au0828 fix to clear enable/disable/change source handlers |
| Date | 2016-03-13 05:00 +0100 |
| Message-ID | <rc5ma-8fn-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
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.
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
drivers/media/usb/au0828/au0828-core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index de9ab11..abdb956 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -137,6 +137,12 @@ 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, change_source */
+ dev->media_dev->source_priv = NULL;
+ dev->media_dev->enable_source = NULL;
+ dev->media_dev->disable_source = NULL;
+ dev->media_dev->change_source = NULL;
+
media_device_unregister(dev->media_dev);
media_device_cleanup(dev->media_dev);
dev->media_dev = NULL;
--
2.5.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] media: au0828 fix to clear enable/disable/change source handlers Shuah Khan <shuahkh@osg.samsung.com> - 2016-03-13 05:00 +0100 Re: [PATCH] media: au0828 fix to clear enable/disable/change source handlers kbuild test robot <lkp@intel.com> - 2016-03-13 05:20 +0100
csiph-web