From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Introduce VPR200 board.
Date: Fri, 14 Jan 2011 11:18:20 +0100 [thread overview]
Message-ID: <20110114101820.GH24920@pengutronix.de> (raw)
In-Reply-To: <20110114100640.GA4589@pengutronix.de>
Hi Wolfram,
On Fri, Jan 14, 2011 at 11:06:40AM +0100, Wolfram Sang wrote:
> > And to do it really correct, you need to check for errors returned by
> > gpio_request and gpio_direction_input.
> >
> > Provided you really need it, I'd do it as follows:
> >
> > int ret;
> >
> > #define setup_for_gpiokey(nr) \
> > ret = gpio_request(GPIO_BUTTON ## nr, "BUTTON" #nr); \
> > if (ret) \
> > return ret; \
> > ret = gpio_direction_input(GPIO_BUTTON ## nr); \
> > if (ret) \
> > return ret; \
> > gpio_free(GPIO_BUTTON ## nr);
> >
> > setup_for_gpiokey(1);
> > setup_for_gpiokey(2);
> > setup_for_gpiokey(3);
> > setup_for_gpiokey(4);
> > ...
>
> I'd think using gpio_request_array() is the better option ;)
didn't know that one, nice.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2011-01-14 10:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 23:48 New i.MX35 based board - VPR200 Marc Reilly
2011-01-13 23:48 ` [PATCH] Introduce VPR200 board Marc Reilly
2011-01-14 0:22 ` Jamie Iles
2011-01-14 8:34 ` Uwe Kleine-König
2011-01-14 10:06 ` Wolfram Sang
2011-01-14 10:18 ` Uwe Kleine-König [this message]
2011-01-14 23:50 ` Marc Reilly
2011-01-14 10:06 ` Sascha Hauer
2011-01-14 14:59 ` Fabio Estevam
2011-01-14 19:32 ` Sascha Hauer
2011-01-15 0:36 ` New i.MX35 based board - VPR200, round 2 Marc Reilly
2011-01-15 0:36 ` [PATCH v2] Introduce VPR200 board Marc Reilly
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=20110114101820.GH24920@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--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).