diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-03-05 18:29:02 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-03-05 18:29:02 +0100 |
commit | 448ddbbbb5b71730762b51de281d8c41ad6342e5 (patch) | |
tree | 5fc9127cfe0b8a9a9f60f7307b4e4d0b455c86ea /media-enumerate.c | |
parent | 67cc5f8c2cdc361204cb5d71fc4a48c344fe95f1 (diff) |
Diffstat (limited to 'media-enumerate.c')
-rw-r--r-- | media-enumerate.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/media-enumerate.c b/media-enumerate.c index 1c3ab38..c0e9eef 100644 --- a/media-enumerate.c +++ b/media-enumerate.c @@ -439,22 +439,20 @@ static int media_enumerate_match_one_video(struct media_enumerate *media_enum, * media device. */ for (i = 0; i < media_enum->devices_count; ++i) { - struct media_entity *entities; unsigned int nents; media = media_enum->devices[i]; - entities = media_get_entities(media); nents = media_get_entities_count(media); for (j = 0; j < nents; ++j) { - struct media_entity *entity = &entities[j]; + struct media_entity *entity = media_get_entity(media, j); + const struct media_entity_desc *info = media_entity_get_info(entity); dev_t dev; - if (entity->info.type != MEDIA_ENT_T_DEVNODE_V4L) + if (info->type != MEDIA_ENT_T_DEVNODE_V4L) continue; - dev = makedev(entity->info.v4l.major, - entity->info.v4l.minor); + dev = makedev(info->v4l.major, info->v4l.minor); if (dev == devnum) return 0; } @@ -531,23 +529,22 @@ static int media_enumerate_match_one_audio(struct media_enumerate *media_enum, return -EINVAL; for (i = 0; i < media_enum->devices_count; ++i) { - struct media_entity *entities; unsigned int nents; media = media_enum->devices[i]; - entities = media_get_entities(media); nents = media_get_entities_count(media); if (!strcmp(media_enum->syspaths[i], syspath)) parent = media; for (j = 0; j < nents; ++j) { - struct media_entity *entity = &entities[j]; + struct media_entity *entity = media_get_entity(media, j); + const struct media_entity_desc *info = media_entity_get_info(entity); - if (entity->info.type != MEDIA_ENT_T_DEVNODE_ALSA) + if (info->type != MEDIA_ENT_T_DEVNODE_ALSA) continue; - if (entity->info.alsa.card == card) + if (info->alsa.card == card) return 0; } } |