diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-12-29 10:04:16 +0100 |
---|---|---|
committer | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2008-12-29 10:04:16 +0100 |
commit | 9a90cc2150ab680bc52a345322a79e901ae22eed (patch) | |
tree | c449e6515b91e29806ae22ecd6507c941cdb2ac0 | |
parent | aa34e3dd9265d2d80d237efb9c2df91e0f138638 (diff) | |
download | mediapointer-dvb-s2-9a90cc2150ab680bc52a345322a79e901ae22eed.tar.gz mediapointer-dvb-s2-9a90cc2150ab680bc52a345322a79e901ae22eed.tar.bz2 |
The failure of set_fmt is solved in tw9910
From: Kuninori Morimoto <morimoto.kuninori@renesas.com>
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: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
drivers/media/video/tw9910.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
-rw-r--r-- | linux/drivers/media/video/tw9910.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/linux/drivers/media/video/tw9910.c b/linux/drivers/media/video/tw9910.c index 75cfde02d..d5cdc4be1 100644 --- a/linux/drivers/media/video/tw9910.c +++ b/linux/drivers/media/video/tw9910.c @@ -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); if (!priv->scale) - return ret; + goto tw9910_set_fmt_error; /* * reset hardware @@ -659,7 +659,8 @@ static int tw9910_set_fmt(struct soc_camera_device *icd, __u32 pixfmt, tw9910_reset(priv->client); ret = tw9910_write_array(priv->client, tw9910_default_regs); if (ret < 0) - return ret; + goto tw9910_set_fmt_error; + /* * set bus width */ @@ -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); if (ret < 0) - return ret; + goto tw9910_set_fmt_error; /* * select MPOUT behavior @@ -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); if (ret < 0) - return ret; + goto tw9910_set_fmt_error; /* * set scale */ ret = tw9910_set_scale(priv->client, priv->scale); if (ret < 0) - return ret; + goto tw9910_set_fmt_error; /* * set cropping */ ret = tw9910_set_cropping(priv->client, &tw9910_cropping_ctrl); if (ret < 0) - return ret; + goto tw9910_set_fmt_error; /* * set hsync */ 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; } |