linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: martin@neutronstar.dyndns.org (martin at neutronstar.dyndns.org)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm: omap3evm: Add support for an MT9M032 based camera board.
Date: Sun, 18 Sep 2011 22:13:36 +0200	[thread overview]
Message-ID: <1316376816.669188.9350@localhost> (raw)
In-Reply-To: <201109180008.21254.laurent.pinchart@ideasonboard.com>

On Sun, Sep 18, 2011 at 12:08:20AM +0200, Laurent Pinchart wrote:
> On Sunday 18 September 2011 00:00:16 Sylwester Nawrocki wrote:
> > On 09/17/2011 11:34 AM, Martin Hostettler wrote:
> > > Adds board support for an MT9M032 based camera to omap3evm.
> > 
> > ...
> > 
> > > +
> > > +static int __init camera_init(void)
> > > +{
> > > +	int ret = -EINVAL;
> > > +
> > > +	omap_mux_init_gpio(nCAM_VD_SEL, OMAP_PIN_OUTPUT);
> > > +	if (gpio_request(nCAM_VD_SEL, "nCAM_VD_SEL")<  0) {
> > > +		pr_err("omap3evm-camera: Failed to get GPIO nCAM_VD_SEL(%d)\n",
> > > +		       nCAM_VD_SEL);
> > > +		goto err;
> > > +	}
> > > +	if (gpio_direction_output(nCAM_VD_SEL, 1)<  0) {
> > > +		pr_err("omap3evm-camera: Failed to set GPIO nCAM_VD_SEL(%d)
> > > direction\n", +		       nCAM_VD_SEL);
> > > +		goto err_vdsel;
> > > +	}
> > 
> > How about replacing gpio_request + gpio_direction_output with:
> > 
> > 	gpio_request_one(nCAM_VD_SEL, GPIOF_OUT_INIT_HIGH, "nCAM_VD_SEL");
> 
> I'd even propose gpio_request_array().
> 

Nice interface. Apart from a bit less detailed error reporting it nicely
simplifies the code. I'll make a new patch using that soon.

 - Martin Hostettler

  reply	other threads:[~2011-09-18 20:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17  9:34 [PATCH v2] arm: omap3evm: Add support for an MT9M032 based camera board Martin Hostettler
2011-09-17 20:24 ` Joe Perches
2011-09-18 20:10   ` martin at neutronstar.dyndns.org
2011-09-17 22:00 ` Sylwester Nawrocki
2011-09-17 22:08   ` Laurent Pinchart
2011-09-18 20:13     ` martin at neutronstar.dyndns.org [this message]
2011-09-18 21:58 ` Laurent Pinchart
2011-09-19  6:07   ` Hiremath, Vaibhav
2011-09-19 19:24     ` martin at neutronstar.dyndns.org
2011-09-19 19:59       ` Hiremath, Vaibhav
2011-09-19  6:10   ` martin at neutronstar.dyndns.org
2011-09-19  8:01     ` Laurent Pinchart
2011-09-19 19:17   ` 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=1316376816.669188.9350@localhost \
    --to=martin@neutronstar.dyndns.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).