diff options
author | Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> | 2021-06-18 21:09:05 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-10-08 11:26:13 +0200 |
commit | 168c05a3e6ac4f575298abbf9a6eef7c1b024f70 (patch) | |
tree | 1d65dcf851c6d25c0156dc2e9717afe454bc5ae5 | |
parent | e73396fee2614145e2f77a88cafbfc25183994f8 (diff) |
media: vsp1: Simplify DRM UIF handling
In commit 6732f3139380 ("media: v4l: vsp1: Fix uif null pointer access")
the handling of the UIF was over complicated, and the patch applied
before review.
Simplify it to keep the conditionals small.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_drm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c index 06f74d410973..0c2507dc03d6 100644 --- a/drivers/media/platform/vsp1/vsp1_drm.c +++ b/drivers/media/platform/vsp1/vsp1_drm.c @@ -455,6 +455,10 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1, dev_err(vsp1->dev, "%s: failed to setup UIF after %s\n", __func__, BRX_NAME(pipe->brx)); + /* If the DRM pipe does not have a UIF there is nothing we can update. */ + if (!drm_pipe->uif) + return 0; + /* * If the UIF is not in use schedule it for removal by setting its pipe * pointer to NULL, vsp1_du_pipeline_configure() will remove it from the @@ -462,9 +466,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1, * make sure it is present in the pipeline's list of entities if it * wasn't already. */ - if (drm_pipe->uif && !use_uif) { + if (!use_uif) { drm_pipe->uif->pipe = NULL; - } else if (drm_pipe->uif && !drm_pipe->uif->pipe) { + } else if (!drm_pipe->uif->pipe) { drm_pipe->uif->pipe = pipe; list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); } |