]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] media: Fix DVB devnode representation at media controller
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 2 Jan 2015 15:18:23 +0000 (12:18 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 13 Feb 2015 23:10:10 +0000 (21:10 -0200)
The previous provision for DVB media controller support were to
define an ID (likely meaning the adapter number) for the DVB
devnodes.

This is just plain wrong. Just like V4L, DVB devices (and any other
device node)) are uniquely identified via a (major, minor) tuple.

This is enough to uniquely identify a devnode, no matter what
API it implements.

So, before we go too far, let's mark the old v4l, fb, dvb and alsa
"devnode" info as deprecated, and just call it as "dev".

We can latter add fields specific to each API if needed.

As we don't want to break compilation on already existing apps,
let's just keep the old definitions as-is, adding a note that
those are deprecated at media-entity.h.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-device.c
include/media/media-entity.h
include/uapi/linux/media.h

index 86bb93fd7db8bd3bd08a630fe379ffe5543abef0..d89d5cb465d9b6db83db36965a4b35e610e31fe3 100644 (file)
@@ -943,8 +943,8 @@ int __video_register_device(struct video_device *vdev, int type, int nr,
            vdev->vfl_type != VFL_TYPE_SUBDEV) {
                vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L;
                vdev->entity.name = vdev->name;
-               vdev->entity.info.v4l.major = VIDEO_MAJOR;
-               vdev->entity.info.v4l.minor = vdev->minor;
+               vdev->entity.info.dev.major = VIDEO_MAJOR;
+               vdev->entity.info.dev.minor = vdev->minor;
                ret = media_device_register_entity(vdev->v4l2_dev->mdev,
                        &vdev->entity);
                if (ret < 0)
index 015f92aab44a85b602c0ae58b3632fe7661015cf..204cc67c84e81dcbf1a2b46448662d8309ead5db 100644 (file)
@@ -248,8 +248,8 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
                        goto clean_up;
                }
 #if defined(CONFIG_MEDIA_CONTROLLER)
-               sd->entity.info.v4l.major = VIDEO_MAJOR;
-               sd->entity.info.v4l.minor = vdev->minor;
+               sd->entity.info.dev.major = VIDEO_MAJOR;
+               sd->entity.info.dev.minor = vdev->minor;
 #endif
                sd->devnode = vdev;
        }
index e00459185d2079161424b069c9e9c6bece2210c5..d6d74bcfe1839e9d89280182164d3e9a9c659ce6 100644 (file)
@@ -87,17 +87,7 @@ struct media_entity {
                struct {
                        u32 major;
                        u32 minor;
-               } v4l;
-               struct {
-                       u32 major;
-                       u32 minor;
-               } fb;
-               struct {
-                       u32 card;
-                       u32 device;
-                       u32 subdevice;
-               } alsa;
-               int dvb;
+               } dev;
 
                /* Sub-device specifications */
                /* Nothing needed yet */
index d847c760e8f09c49fec028cbe3a7b599cee2e60f..418f4fec391a17fc66ba2e4a129e5875f283a407 100644 (file)
@@ -75,6 +75,20 @@ struct media_entity_desc {
 
        union {
                /* Node specifications */
+               struct {
+                       __u32 major;
+                       __u32 minor;
+               } dev;
+
+#if 1
+               /*
+                * DEPRECATED: previous node specifications. Kept just to
+                * avoid breaking compilation, but media_entity_desc.dev
+                * should be used instead. In particular, alsa and dvb
+                * fields below are wrong: for all devnodes, there should
+                * be just major/minor inside the struct, as this is enough
+                * to represent any devnode, no matter what type.
+                */
                struct {
                        __u32 major;
                        __u32 minor;
@@ -89,6 +103,7 @@ struct media_entity_desc {
                        __u32 subdevice;
                } alsa;
                int dvb;
+#endif
 
                /* Sub-device specifications */
                /* Nothing needed yet */