All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas THERY <nicolas.thery@st.com>
To: Prashanth Subramanya <sprashanth@aptina.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"mchehab@infradead.org" <mchehab@infradead.org>,
	"g.liakhovetski@gmx.de" <g.liakhovetski@gmx.de>,
	"laurent.pinchart@ideasonboard.com"
	<laurent.pinchart@ideasonboard.com>,
	"s.nawrocki@samsung.com" <s.nawrocki@samsung.com>,
	"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
	"sakari.ailus@maxwell.research.nokia.com"
	<sakari.ailus@maxwell.research.nokia.com>,
	"scott.jiang.linux@gmail.com" <scott.jiang.linux@gmail.com>
Subject: Re: [PATCH] drivers: media: video: Add support for Aptina ar0130 sensor
Date: Tue, 11 Sep 2012 16:00:23 +0200	[thread overview]
Message-ID: <504F43F7.10504@st.com> (raw)
In-Reply-To: <1347010226-12546-1-git-send-email-sprashanth@aptina.com>

Hello,

I've spotted a minor issue while glancing through the code.

Cheers,
Nicolas

On 2012-09-07 11:30, Prashanth Subramanya wrote:
> This driver adds basic support for Aptina ar0130 1.2M sensor.
> 
> Signed-off-by: Prashanth Subramanya <sprashanth@aptina.com>
> ---
[snip]
> +/***************************************************
> +               v4l2_subdev_video_ops
> +****************************************************/
> +static int ar0130_s_stream(struct v4l2_subdev *sd, int enable)
> +{
> +       struct i2c_client *client = v4l2_get_subdevdata(sd);
> +       struct ar0130_priv *ar0130 = container_of(sd,
> +                                       struct ar0130_priv, subdev);
> +       int ret;
> +
> +       if (!enable) {
> +               ret = ar0130_write(client, AR0130_RESET_REG, AR0130_STREAM_OFF);
> +               return 0;
> +       }
> +
> +       ret = ar0130_linear_mode_setup(client);
> +       if (ret < 0) {
> +               dev_err(ar0130->subdev.v4l2_dev->dev,
> +                       "Failed to setup linear mode: %d\n", ret);
> +               return ret;
> +       }
> +
> +       ret = ar0130_set_resolution(client, ar0130->res_index);
> +       if (ret < 0) {
> +               dev_err(ar0130->subdev.v4l2_dev->dev,
> +                       "Failed to setup resolution: %d\n", ret);
> +               return ret;
> +       }
> +
> +       ret |= ar0130_write(client, AR0130_RESET_REG, AR0130_STREAM_OFF);
> +       ret |= ar0130_write(client, AR0130_HDR_COMP, 0x0001);
> +
> +       ret = ar0130_pll_enable(ar0130);

The previous value of ret is overwritten here.

> +       if (ret < 0) {
> +               dev_err(ar0130->subdev.v4l2_dev->dev,
> +                       "Failed to enable pll: %d\n", ret);
> +               return ret;
> +       }
> +
> +       ret  = ar0130_set_autoexposure(client, AR0130_ENABLE);
> +       ret |= ar0130_write(client, AR0130_RESET_REG, AR0130_STREAM_ON);
> +
> +       return ret;
> +}

      parent reply	other threads:[~2012-09-11 14:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-07  9:30 [PATCH] drivers: media: video: Add support for Aptina ar0130 sensor Prashanth Subramanya
2012-09-07 10:30 ` Hans Verkuil
2012-09-07 11:22   ` Subramanya Prashanth
2012-09-09 21:02 ` Guennadi Liakhovetski
2012-09-11 14:00 ` Nicolas THERY [this message]

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=504F43F7.10504@st.com \
    --to=nicolas.thery@st.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=s.nawrocki@samsung.com \
    --cc=sakari.ailus@maxwell.research.nokia.com \
    --cc=scott.jiang.linux@gmail.com \
    --cc=sprashanth@aptina.com \
    /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.