This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] au0828: Unregister notifiers
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Wed Mar 16 09:04:04 2016 -0300

If au0828 gets removed, we need to remove the notifiers.

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/usb/au0828/au0828-core.c | 36 +++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=26f2b92c7228d730c146e8a54f1219ffe419e390
diff --git a/drivers/media/usb/au0828/au0828-core.c 
b/drivers/media/usb/au0828/au0828-core.c
index 2fcd17d9b1a6..06da73f1ff22 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -131,21 +131,35 @@ static int recv_control_msg(struct au0828_dev *dev, u16 
request, u32 value,
        return status;
 }
 
+#ifdef CONFIG_MEDIA_CONTROLLER
+static void au0828_media_graph_notify(struct media_entity *new,
+                                     void *notify_data);
+#endif
+
 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;
+       struct media_device *mdev = dev->media_dev;
+       struct media_entity_notify *notify, *nextp;
+
+       if (!mdev || !media_devnode_is_registered(&mdev->devnode))
+               return;
+
+       /* Remove au0828 entity_notify callbacks */
+       list_for_each_entry_safe(notify, nextp, &mdev->entity_notify, list) {
+               if (notify->notify != au0828_media_graph_notify)
+                       continue;
+               media_device_unregister_entity_notify(mdev, notify);
        }
+
+       /* 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;
 #endif
 }
 

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to