Commit 6d756112 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mauro Carvalho Chehab

V4L/DVB (10095): The failure of set_fmt is solved in tw9910

priv->scale is checked in start_capture.
Therefore, it should be NULL if failing in set_fmt.
This patch resolve this problem.
Signed-off-by: default avatarKuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ed922a89
...@@ -651,7 +651,7 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt, ...@@ -651,7 +651,7 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
*/ */
priv->scale = tw9910_select_norm(icd, rect->width, rect->height); priv->scale = tw9910_select_norm(icd, rect->width, rect->height);
if (!priv->scale) if (!priv->scale)
return ret; goto tw9910_set_fmt_error;
/* /*
* reset hardware * reset hardware
...@@ -659,7 +659,8 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt, ...@@ -659,7 +659,8 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
tw9910_reset(priv->client); tw9910_reset(priv->client);
ret = tw9910_write_array(priv->client, tw9910_default_regs); ret = tw9910_write_array(priv->client, tw9910_default_regs);
if (ret < 0) if (ret < 0)
return ret; goto tw9910_set_fmt_error;
/* /*
* set bus width * set bus width
*/ */
...@@ -669,7 +670,7 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt, ...@@ -669,7 +670,7 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
ret = tw9910_mask_set(priv->client, OPFORM, LEN, val); ret = tw9910_mask_set(priv->client, OPFORM, LEN, val);
if (ret < 0) if (ret < 0)
return ret; goto tw9910_set_fmt_error;
/* /*
* select MPOUT behavior * select MPOUT behavior
...@@ -697,26 +698,35 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt, ...@@ -697,26 +698,35 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt,
ret = tw9910_mask_set(priv->client, VBICNTL, RTSEL_MASK, val); ret = tw9910_mask_set(priv->client, VBICNTL, RTSEL_MASK, val);
if (ret < 0) if (ret < 0)
return ret; goto tw9910_set_fmt_error;
/* /*
* set scale * set scale
*/ */
ret = tw9910_set_scale(priv->client, priv->scale); ret = tw9910_set_scale(priv->client, priv->scale);
if (ret < 0) if (ret < 0)
return ret; goto tw9910_set_fmt_error;
/* /*
* set cropping * set cropping
*/ */
ret = tw9910_set_cropping(priv->client, &tw9910_cropping_ctrl); ret = tw9910_set_cropping(priv->client, &tw9910_cropping_ctrl);
if (ret < 0) if (ret < 0)
return ret; goto tw9910_set_fmt_error;
/* /*
* set hsync * set hsync
*/ */
ret = tw9910_set_hsync(priv->client, &tw9910_hsync_ctrl); ret = tw9910_set_hsync(priv->client, &tw9910_hsync_ctrl);
if (ret < 0)
goto tw9910_set_fmt_error;
return ret;
tw9910_set_fmt_error:
tw9910_reset(priv->client);
priv->scale = NULL;
return ret; return ret;
} }
......
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