Make the dvb core CA support aware of the media controller and
register the corresponding devices.

Signed-off-by: Mauro Carvalho Chehab <mche...@osg.samsung.com>

diff --git a/drivers/media/dvb-core/dvb_ca_en50221.c 
b/drivers/media/dvb-core/dvb_ca_en50221.c
index 0aac3096728e..011cb2bc04e1 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb-core/dvb_ca_en50221.c
@@ -1638,14 +1638,6 @@ static const struct file_operations dvb_ca_fops = {
        .llseek = noop_llseek,
 };
 
-static struct dvb_device dvbdev_ca = {
-       .priv = NULL,
-       .users = 1,
-       .readers = 1,
-       .writers = 1,
-       .fops = &dvb_ca_fops,
-};
-
 
 /* 
********************************************************************************
 */
 /* Initialisation/shutdown functions */
@@ -1667,6 +1659,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
        int ret;
        struct dvb_ca_private *ca = NULL;
        int i;
+       struct dvb_device dvbdev_ca = {
+               .priv = NULL,
+               .users = 1,
+               .readers = 1,
+               .writers = 1,
+               .fops = &dvb_ca_fops,
+#if defined(CONFIG_MEDIA_CONTROLLER)
+               .mdev = pubca->mdev,
+               .name = "ca_en50221",
+#endif
+       };
 
        dprintk("%s\n", __func__);
 
diff --git a/drivers/media/dvb-core/dvb_ca_en50221.h 
b/drivers/media/dvb-core/dvb_ca_en50221.h
index 7df2e141187a..c8e69f418eb5 100644
--- a/drivers/media/dvb-core/dvb_ca_en50221.h
+++ b/drivers/media/dvb-core/dvb_ca_en50221.h
@@ -24,6 +24,8 @@
 #include <linux/list.h>
 #include <linux/dvb/ca.h>
 
+#include <media/media-device.h>
+
 #include "dvbdev.h"
 
 #define DVB_CA_EN50221_POLL_CAM_PRESENT        1
@@ -74,6 +76,10 @@ struct dvb_ca_en50221 {
 
        /* Opaque data used by the dvb_ca core. Do not modify! */
        void* private;
+
+#if defined(CONFIG_MEDIA_CONTROLLER)
+       struct media_device *mdev;
+#endif
 };
 
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to