Skip to content

Commit

Permalink
media: bcm2835-unicam: reset fmt after set selection
Browse files Browse the repository at this point in the history
Signed-off-by: Vinay Varma <[email protected]>
  • Loading branch information
vvarma committed Sep 19, 2023
1 parent 543deea commit b2309ba
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/media/platform/bcm2835/bcm2835-unicam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,7 @@ static int unicam_g_edid(struct file *file, void *priv, struct v4l2_edid *edid)
static int unicam_s_selection(struct file *file, void *priv,
struct v4l2_selection *sel)
{
int ret;
struct unicam_node *node = video_drvdata(file);
struct unicam_device *dev = node->dev;
struct v4l2_subdev_selection sdsel = {
Expand All @@ -1561,7 +1562,12 @@ static int unicam_s_selection(struct file *file, void *priv,
if (sel->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

return v4l2_subdev_call(dev->sensor, pad, set_selection, NULL, &sdsel);
ret = v4l2_subdev_call(dev->sensor, pad, set_selection, NULL, &sdsel);
if (ret < 0)
return ret;

node->v_fmt.fmt.pix.bytesperline = 0;
return unicam_reset_format(node);
}

static int unicam_g_selection(struct file *file, void *priv,
Expand Down

0 comments on commit b2309ba

Please sign in to comment.