Commit 6b1446bc authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: vsp1: video: Fix coding style

Commit 54b5a749 ("[media] v4l: vsp1: Use media entity enumeration
interface") wasn't aligned with the driver coding style. Fix it by
renaming the rval variable to ret.

Furthermore shorten lines by accessing the media_device instance in a
more straightforward fashion.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent c1741af7
...@@ -175,31 +175,30 @@ static int vsp1_video_pipeline_validate_branch(struct vsp1_pipeline *pipe, ...@@ -175,31 +175,30 @@ static int vsp1_video_pipeline_validate_branch(struct vsp1_pipeline *pipe,
struct vsp1_rwpf *input, struct vsp1_rwpf *input,
struct vsp1_rwpf *output) struct vsp1_rwpf *output)
{ {
struct vsp1_entity *entity;
struct media_entity_enum ent_enum; struct media_entity_enum ent_enum;
struct vsp1_entity *entity;
struct media_pad *pad; struct media_pad *pad;
int rval;
bool bru_found = false; bool bru_found = false;
int ret;
input->location.left = 0; input->location.left = 0;
input->location.top = 0; input->location.top = 0;
rval = media_entity_enum_init( ret = media_entity_enum_init(&ent_enum, &input->entity.vsp1->media_dev);
&ent_enum, input->entity.pads[RWPF_PAD_SOURCE].graph_obj.mdev); if (ret < 0)
if (rval) return ret;
return rval;
pad = media_entity_remote_pad(&input->entity.pads[RWPF_PAD_SOURCE]); pad = media_entity_remote_pad(&input->entity.pads[RWPF_PAD_SOURCE]);
while (1) { while (1) {
if (pad == NULL) { if (pad == NULL) {
rval = -EPIPE; ret = -EPIPE;
goto out; goto out;
} }
/* We've reached a video node, that shouldn't have happened. */ /* We've reached a video node, that shouldn't have happened. */
if (!is_media_entity_v4l2_subdev(pad->entity)) { if (!is_media_entity_v4l2_subdev(pad->entity)) {
rval = -EPIPE; ret = -EPIPE;
goto out; goto out;
} }
...@@ -229,14 +228,14 @@ static int vsp1_video_pipeline_validate_branch(struct vsp1_pipeline *pipe, ...@@ -229,14 +228,14 @@ static int vsp1_video_pipeline_validate_branch(struct vsp1_pipeline *pipe,
/* Ensure the branch has no loop. */ /* Ensure the branch has no loop. */
if (media_entity_enum_test_and_set(&ent_enum, if (media_entity_enum_test_and_set(&ent_enum,
&entity->subdev.entity)) { &entity->subdev.entity)) {
rval = -EPIPE; ret = -EPIPE;
goto out; goto out;
} }
/* UDS can't be chained. */ /* UDS can't be chained. */
if (entity->type == VSP1_ENTITY_UDS) { if (entity->type == VSP1_ENTITY_UDS) {
if (pipe->uds) { if (pipe->uds) {
rval = -EPIPE; ret = -EPIPE;
goto out; goto out;
} }
...@@ -256,12 +255,12 @@ static int vsp1_video_pipeline_validate_branch(struct vsp1_pipeline *pipe, ...@@ -256,12 +255,12 @@ static int vsp1_video_pipeline_validate_branch(struct vsp1_pipeline *pipe,
/* The last entity must be the output WPF. */ /* The last entity must be the output WPF. */
if (entity != &output->entity) if (entity != &output->entity)
rval = -EPIPE; ret = -EPIPE;
out: out:
media_entity_enum_cleanup(&ent_enum); media_entity_enum_cleanup(&ent_enum);
return rval; return ret;
} }
static int vsp1_video_pipeline_validate(struct vsp1_pipeline *pipe, static int vsp1_video_pipeline_validate(struct vsp1_pipeline *pipe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment