diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-11-05 17:42:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-20 06:31:50 -0500 |
commit | fa5034c667c224be48db31a0d043dba305e8e7a8 (patch) | |
tree | f5b74b0c5c23797016fa5357e396e10e11d8c3c8 | |
parent | c1026c580df130c1d1943fff99bae0bef2cafa7b (diff) |
[media] media: fix truncated entity specification
When enumerating an entity, assign the entire entity specification
instead of only the first two words. (This requires giving the
specification union a name.)
So far, no driver actually uses more than two words, but this will
be needed for ALSA entities.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
[laurent.pinchart@ideasonboard.com: Rename specification to info]
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/media-device.c | 3 | ||||
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 4 | ||||
-rw-r--r-- | drivers/media/video/v4l2-device.c | 4 | ||||
-rw-r--r-- | include/media/media-entity.h | 2 |
4 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 6edc9ba81203..6f9eb94e85b3 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c | |||
@@ -108,8 +108,7 @@ static long media_device_enum_entities(struct media_device *mdev, | |||
108 | u_ent.group_id = ent->group_id; | 108 | u_ent.group_id = ent->group_id; |
109 | u_ent.pads = ent->num_pads; | 109 | u_ent.pads = ent->num_pads; |
110 | u_ent.links = ent->num_links - ent->num_backlinks; | 110 | u_ent.links = ent->num_links - ent->num_backlinks; |
111 | u_ent.v4l.major = ent->v4l.major; | 111 | memcpy(&u_ent.raw, &ent->info, sizeof(ent->info)); |
112 | u_ent.v4l.minor = ent->v4l.minor; | ||
113 | if (copy_to_user(uent, &u_ent, sizeof(u_ent))) | 112 | if (copy_to_user(uent, &u_ent, sizeof(u_ent))) |
114 | return -EFAULT; | 113 | return -EFAULT; |
115 | return 0; | 114 | return 0; |
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 6a07d283456b..96e9615663e9 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -701,8 +701,8 @@ int __video_register_device(struct video_device *vdev, int type, int nr, | |||
701 | vdev->vfl_type != VFL_TYPE_SUBDEV) { | 701 | vdev->vfl_type != VFL_TYPE_SUBDEV) { |
702 | vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; | 702 | vdev->entity.type = MEDIA_ENT_T_DEVNODE_V4L; |
703 | vdev->entity.name = vdev->name; | 703 | vdev->entity.name = vdev->name; |
704 | vdev->entity.v4l.major = VIDEO_MAJOR; | 704 | vdev->entity.info.v4l.major = VIDEO_MAJOR; |
705 | vdev->entity.v4l.minor = vdev->minor; | 705 | vdev->entity.info.v4l.minor = vdev->minor; |
706 | ret = media_device_register_entity(vdev->v4l2_dev->mdev, | 706 | ret = media_device_register_entity(vdev->v4l2_dev->mdev, |
707 | &vdev->entity); | 707 | &vdev->entity); |
708 | if (ret < 0) | 708 | if (ret < 0) |
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c index 0edd618b9ddf..1f203b85a637 100644 --- a/drivers/media/video/v4l2-device.c +++ b/drivers/media/video/v4l2-device.c | |||
@@ -234,8 +234,8 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev) | |||
234 | goto clean_up; | 234 | goto clean_up; |
235 | } | 235 | } |
236 | #if defined(CONFIG_MEDIA_CONTROLLER) | 236 | #if defined(CONFIG_MEDIA_CONTROLLER) |
237 | sd->entity.v4l.major = VIDEO_MAJOR; | 237 | sd->entity.info.v4l.major = VIDEO_MAJOR; |
238 | sd->entity.v4l.minor = vdev->minor; | 238 | sd->entity.info.v4l.minor = vdev->minor; |
239 | #endif | 239 | #endif |
240 | sd->devnode = vdev; | 240 | sd->devnode = vdev; |
241 | } | 241 | } |
diff --git a/include/media/media-entity.h b/include/media/media-entity.h index cd8bca63a502..29e7bba78ffe 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h | |||
@@ -98,7 +98,7 @@ struct media_entity { | |||
98 | 98 | ||
99 | /* Sub-device specifications */ | 99 | /* Sub-device specifications */ |
100 | /* Nothing needed yet */ | 100 | /* Nothing needed yet */ |
101 | }; | 101 | } info; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | static inline u32 media_entity_type(struct media_entity *entity) | 104 | static inline u32 media_entity_type(struct media_entity *entity) |