All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 2/3] smiapp: Check for GPIO validity using gpio_is_valid()
Date: Fri, 09 May 2014 14:18:24 +0200	[thread overview]
Message-ID: <5427082.Dc0ESfsmo0@avalon> (raw)
In-Reply-To: <1399163517-5220-3-git-send-email-sakari.ailus@iki.fi>

Hi Sakari,

Thank you for the patch.

On Sunday 04 May 2014 03:31:56 Sakari Ailus wrote:
> Do not use our special value, SMIAPP_NO_XSHUTDOWN.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>

Wouldn't it make sense to switch to the gpiod API ? That change could then 
replace this patch. If you would like to do so in an incremental patch 
instead,

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/smiapp/smiapp-core.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c
> b/drivers/media/i2c/smiapp/smiapp-core.c index c1d6d1d..e4037c8 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -1128,7 +1128,7 @@ static int smiapp_power_on(struct smiapp_sensor
> *sensor) }
>  	usleep_range(1000, 1000);
> 
> -	if (sensor->platform_data->xshutdown != SMIAPP_NO_XSHUTDOWN)
> +	if (gpio_is_valid(sensor->platform_data->xshutdown))
>  		gpio_set_value(sensor->platform_data->xshutdown, 1);
> 
>  	sleep = SMIAPP_RESET_DELAY(sensor->platform_data->ext_clk);
> @@ -1238,7 +1238,7 @@ static int smiapp_power_on(struct smiapp_sensor
> *sensor) return 0;
> 
>  out_cci_addr_fail:
> -	if (sensor->platform_data->xshutdown != SMIAPP_NO_XSHUTDOWN)
> +	if (gpio_is_valid(sensor->platform_data->xshutdown))
>  		gpio_set_value(sensor->platform_data->xshutdown, 0);
>  	if (sensor->platform_data->set_xclk)
>  		sensor->platform_data->set_xclk(&sensor->src->sd, 0);
> @@ -1264,7 +1264,7 @@ static void smiapp_power_off(struct smiapp_sensor
> *sensor) SMIAPP_REG_U8_SOFTWARE_RESET,
>  			     SMIAPP_SOFTWARE_RESET);
> 
> -	if (sensor->platform_data->xshutdown != SMIAPP_NO_XSHUTDOWN)
> +	if (gpio_is_valid(sensor->platform_data->xshutdown))
>  		gpio_set_value(sensor->platform_data->xshutdown, 0);
>  	if (sensor->platform_data->set_xclk)
>  		sensor->platform_data->set_xclk(&sensor->src->sd, 0);
> @@ -2378,7 +2378,7 @@ static int smiapp_registered(struct v4l2_subdev
> *subdev) }
>  	}
> 
> -	if (sensor->platform_data->xshutdown != SMIAPP_NO_XSHUTDOWN) {
> +	if (gpio_is_valid(sensor->platform_data->xshutdown)) {
>  		if (devm_gpio_request_one(&client->dev,
>  					  sensor->platform_data->xshutdown, 0,
>  					  "SMIA++ xshutdown") != 0) {
> @@ -2830,7 +2830,7 @@ static int smiapp_remove(struct i2c_client *client)
>  	unsigned int i;
> 
>  	if (sensor->power_count) {
> -		if (sensor->platform_data->xshutdown != SMIAPP_NO_XSHUTDOWN)
> +		if (gpio_is_valid(sensor->platform_data->xshutdown))
>  			gpio_set_value(sensor->platform_data->xshutdown, 0);
>  		if (sensor->platform_data->set_xclk)
>  			sensor->platform_data->set_xclk(&sensor->src->sd, 0);

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-05-09 12:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-04  0:31 smiapp: Minor improvements, early preparation for DT support Sakari Ailus
2014-05-04  0:31 ` [PATCH 1/3] smiapp: Use better regulator name for the Device tree Sakari Ailus
2014-05-09 12:16   ` Laurent Pinchart
2014-05-04  0:31 ` [PATCH 2/3] smiapp: Check for GPIO validity using gpio_is_valid() Sakari Ailus
2014-05-09 12:18   ` Laurent Pinchart [this message]
2014-05-09 12:38     ` Sakari Ailus
2014-05-04  0:31 ` [PATCH 3/3] smiapp: Return correct return value in smiapp_registered() Sakari Ailus
2014-05-09 12:17   ` Laurent Pinchart

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=5427082.Dc0ESfsmo0@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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.