From: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, Prabhakar Lad <prabhakar.csengg@gmail.com>
Subject: Re: [PATCH] mt9p031: Use gpio_is_valid()
Date: Thu, 02 May 2013 22:15:33 +0200 [thread overview]
Message-ID: <5182C965.1040804@gmail.com> (raw)
In-Reply-To: <1367492652-28704-1-git-send-email-laurent.pinchart@ideasonboard.com>
On 05/02/2013 01:04 PM, Laurent Pinchart wrote:
> Replace the manual validity checks for the reset GPIO with the
> gpio_is_valid() function.
>
> Signed-off-by: Laurent Pinchart<laurent.pinchart@ideasonboard.com>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> ---
> drivers/media/i2c/mt9p031.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index 8de84c0..bf49899 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -272,7 +272,7 @@ static inline int mt9p031_pll_disable(struct mt9p031 *mt9p031)
> static int mt9p031_power_on(struct mt9p031 *mt9p031)
> {
> /* Ensure RESET_BAR is low */
> - if (mt9p031->reset != -1) {
> + if (gpio_is_valid(mt9p031->reset)) {
> gpio_set_value(mt9p031->reset, 0);
> usleep_range(1000, 2000);
> }
> @@ -287,7 +287,7 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
> clk_prepare_enable(mt9p031->clk);
>
> /* Now RESET_BAR must be high */
> - if (mt9p031->reset != -1) {
> + if (gpio_is_valid(mt9p031->reset)) {
> gpio_set_value(mt9p031->reset, 1);
> usleep_range(1000, 2000);
> }
> @@ -297,7 +297,7 @@ static int mt9p031_power_on(struct mt9p031 *mt9p031)
>
> static void mt9p031_power_off(struct mt9p031 *mt9p031)
> {
> - if (mt9p031->reset != -1) {
> + if (gpio_is_valid(mt9p031->reset)) {
> gpio_set_value(mt9p031->reset, 0);
> usleep_range(1000, 2000);
> }
> @@ -1031,7 +1031,7 @@ static int mt9p031_probe(struct i2c_client *client,
> mt9p031->format.field = V4L2_FIELD_NONE;
> mt9p031->format.colorspace = V4L2_COLORSPACE_SRGB;
>
> - if (pdata->reset != -1) {
> + if (gpio_is_valid(pdata->reset)) {
> ret = devm_gpio_request_one(&client->dev, pdata->reset,
> GPIOF_OUT_INIT_LOW, "mt9p031_rst");
> if (ret< 0)
next prev parent reply other threads:[~2013-05-02 20:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 11:04 [PATCH] mt9p031: Use gpio_is_valid() Laurent Pinchart
2013-05-02 20:15 ` Sylwester Nawrocki [this message]
2013-05-03 6:12 ` Prabhakar Lad
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=5182C965.1040804@gmail.com \
--to=sylvester.nawrocki@gmail.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=prabhakar.csengg@gmail.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.