diff options
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-subdev.c')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-subdev.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c index dced41c1d993..996c248dea42 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c | |||
@@ -412,20 +412,20 @@ static int | |||
412 | v4l2_subdev_link_validate_get_format(struct media_pad *pad, | 412 | v4l2_subdev_link_validate_get_format(struct media_pad *pad, |
413 | struct v4l2_subdev_format *fmt) | 413 | struct v4l2_subdev_format *fmt) |
414 | { | 414 | { |
415 | switch (media_entity_type(pad->entity)) { | 415 | if (media_entity_type(pad->entity) == MEDIA_ENT_T_V4L2_SUBDEV) { |
416 | case MEDIA_ENT_T_V4L2_SUBDEV: | 416 | struct v4l2_subdev *sd = |
417 | media_entity_to_v4l2_subdev(pad->entity); | ||
418 | |||
417 | fmt->which = V4L2_SUBDEV_FORMAT_ACTIVE; | 419 | fmt->which = V4L2_SUBDEV_FORMAT_ACTIVE; |
418 | fmt->pad = pad->index; | 420 | fmt->pad = pad->index; |
419 | return v4l2_subdev_call(media_entity_to_v4l2_subdev( | 421 | return v4l2_subdev_call(sd, pad, get_fmt, NULL, fmt); |
420 | pad->entity), | ||
421 | pad, get_fmt, NULL, fmt); | ||
422 | default: | ||
423 | WARN(1, "Driver bug! Wrong media entity type %d, entity %s\n", | ||
424 | media_entity_type(pad->entity), pad->entity->name); | ||
425 | /* Fall through */ | ||
426 | case MEDIA_ENT_T_DEVNODE_V4L: | ||
427 | return -EINVAL; | ||
428 | } | 422 | } |
423 | |||
424 | WARN(pad->entity->type != MEDIA_ENT_T_DEVNODE_V4L, | ||
425 | "Driver bug! Wrong media entity type 0x%08x, entity %s\n", | ||
426 | pad->entity->type, pad->entity->name); | ||
427 | |||
428 | return -EINVAL; | ||
429 | } | 429 | } |
430 | 430 | ||
431 | int v4l2_subdev_link_validate(struct media_link *link) | 431 | int v4l2_subdev_link_validate(struct media_link *link) |