All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Michael Grzeschik <m.grzeschik@pengutronix.de>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v2] mt9m111: move lastpage to struct mt9m111 for multi instances
Date: Tue, 19 Jul 2011 16:10:52 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1107191608040.1008@axis700.grange> (raw)
In-Reply-To: <1311081995-25409-1-git-send-email-m.grzeschik@pengutronix.de>

Hi Michael

Looks good now, thanks. Unfortunately, we've already missed the 3.1 merge 
window, unless Linus decides to release one more 3.0-rcX kernel. But 
still, I think, this can qualify as a fix, so, it should be ok even after 
-rc1.

Thanks
Guennadi

On Tue, 19 Jul 2011, Michael Grzeschik wrote:

> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
> ---
> v1 -> v2: added initial value -1 for lastpage
> 
>  drivers/media/video/mt9m111.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/video/mt9m111.c b/drivers/media/video/mt9m111.c
> index a357aa8..07af26e 100644
> --- a/drivers/media/video/mt9m111.c
> +++ b/drivers/media/video/mt9m111.c
> @@ -184,6 +184,7 @@ struct mt9m111 {
>  	struct mutex power_lock; /* lock to protect power_count */
>  	int power_count;
>  	const struct mt9m111_datafmt *fmt;
> +	int lastpage;	/* PageMap cache value */
>  	unsigned int gain;
>  	unsigned char autoexposure;
>  	unsigned char datawidth;
> @@ -202,17 +203,17 @@ static int reg_page_map_set(struct i2c_client *client, const u16 reg)
>  {
>  	int ret;
>  	u16 page;
> -	static int lastpage = -1;	/* PageMap cache value */
> +	struct mt9m111 *mt9m111 = to_mt9m111(client);
>  
>  	page = (reg >> 8);
> -	if (page == lastpage)
> +	if (page == mt9m111->lastpage)
>  		return 0;
>  	if (page > 2)
>  		return -EINVAL;
>  
>  	ret = i2c_smbus_write_word_data(client, MT9M111_PAGE_MAP, swab16(page));
>  	if (!ret)
> -		lastpage = page;
> +		mt9m111->lastpage = page;
>  	return ret;
>  }
>  
> @@ -932,6 +933,8 @@ static int mt9m111_video_probe(struct soc_camera_device *icd,
>  	BUG_ON(!icd->parent ||
>  	       to_soc_camera_host(icd->parent)->nr != icd->iface);
>  
> +	mt9m111->lastpage = -1;
> +
>  	mt9m111->autoexposure = 1;
>  	mt9m111->autowhitebalance = 1;
>  
> -- 
> 1.7.5.4
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

  reply	other threads:[~2011-07-19 14:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 15:39 [PATCH 1/5] mt9m111: set inital return values to zero Michael Grzeschik
2011-07-12 15:39 ` [PATCH 2/5] mt9m111: fix missing return value check mt9m111_reg_clear Michael Grzeschik
2011-07-17 16:54   ` Guennadi Liakhovetski
2011-07-12 15:39 ` [PATCH 3/5] mt9m111: move lastpage to struct mt9m111 for multi instances Michael Grzeschik
2011-07-14 15:27   ` Laurent Pinchart
2011-07-17 16:53     ` Guennadi Liakhovetski
2011-07-19 13:26   ` [PATCH v2] " Michael Grzeschik
2011-07-19 14:10     ` Guennadi Liakhovetski [this message]
2011-07-12 15:39 ` [PATCH v4 4/5] mt9m111: rewrite set_pixfmt Michael Grzeschik
2011-07-17 17:09   ` Guennadi Liakhovetski
2011-07-22 11:57     ` Michael Grzeschik
2011-07-12 15:39 ` [PATCH 5/5] mt9m111: make use of testpattern Michael Grzeschik
2011-07-17 16:55   ` Guennadi Liakhovetski
2011-07-14 15:25 ` [PATCH 1/5] mt9m111: set inital return values to zero Laurent Pinchart
2011-07-17 16:52   ` Guennadi Liakhovetski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.1107191608040.1008@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    --cc=m.grzeschik@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.