Make the dvb core demux 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/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index abff803ad69a..9071636534db 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -1136,13 +1136,6 @@ static const struct file_operations dvb_demux_fops = {
        .llseek = default_llseek,
 };
 
-static struct dvb_device dvbdev_demux = {
-       .priv = NULL,
-       .users = 1,
-       .writers = 1,
-       .fops = &dvb_demux_fops
-};
-
 static int dvb_dvr_do_ioctl(struct file *file,
                            unsigned int cmd, void *parg)
 {
@@ -1209,16 +1202,29 @@ static const struct file_operations dvb_dvr_fops = {
        .llseek = default_llseek,
 };
 
-static struct dvb_device dvbdev_dvr = {
-       .priv = NULL,
-       .readers = 1,
-       .users = 1,
-       .fops = &dvb_dvr_fops
-};
-
 int dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
 {
        int i;
+       struct dvb_device dvbdev_demux = {
+               .priv = NULL,
+               .users = 1,
+               .writers = 1,
+               .fops = &dvb_demux_fops,
+#if defined(CONFIG_MEDIA_CONTROLLER)
+               .mdev = dmxdev->mdev,
+               .name = "demux",
+#endif
+       };
+       struct dvb_device dvbdev_dvr = {
+               .priv = NULL,
+               .readers = 1,
+               .users = 1,
+               .fops = &dvb_dvr_fops,
+#if defined(CONFIG_MEDIA_CONTROLLER)
+               .mdev = dmxdev->mdev,
+               .name = "dvr",
+#endif
+       };
 
        if (dmxdev->demux->open(dmxdev->demux) < 0)
                return -EUSERS;
diff --git a/drivers/media/dvb-core/dmxdev.h b/drivers/media/dvb-core/dmxdev.h
index 48c6cf92ab99..09832a8e6956 100644
--- a/drivers/media/dvb-core/dmxdev.h
+++ b/drivers/media/dvb-core/dmxdev.h
@@ -36,6 +36,8 @@
 
 #include <linux/dvb/dmx.h>
 
+#include <media/media-device.h>
+
 #include "dvbdev.h"
 #include "demux.h"
 #include "dvb_ringbuffer.h"
@@ -110,6 +112,10 @@ struct dmxdev {
 
        struct mutex mutex;
        spinlock_t lock;
+
+#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