Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1553818

Re: [PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()

From Jonathan Cameron <jic23@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 02/19] staging: iio: isl29028: remove enable flag from isl29028_enable_proximity()
Date 2017-01-08 10:50 +0100
Message-ID <sXigW-4z0-33@gated-at.bofh.it> (permalink)
References <sKuIV-194-3@gated-at.bofh.it> <sKuIV-194-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 04/12/16 02:19, Brian Masney wrote:
> isl29028_enable_proximity() has a boolean argument named enable. This
> function is only called once and the enable flag is set to true in that
> call. This patch removes the enable parameter from that function.
> 
> Signed-off-by: Brian Masney <masneyb@onstation.org>
On second thoughts (stupid email is hiding somewhere to be sent when I have wifi
so can't reply to it) perhaps this is a coarse way of only turning proximity on if
the LED is present?  Not sure...
> ---
>  drivers/staging/iio/light/isl29028.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
> index 4e35d00..c8e234d 100644
> --- a/drivers/staging/iio/light/isl29028.c
> +++ b/drivers/staging/iio/light/isl29028.c
> @@ -93,15 +93,13 @@ static int isl29028_set_proxim_sampling(struct isl29028_chip *chip,
>  				  sel << ISL29028_CONF_PROX_SLP_SH);
>  }
>  
> -static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable)
> +static int isl29028_enable_proximity(struct isl29028_chip *chip)
>  {
>  	int ret;
> -	int val = 0;
>  
> -	if (enable)
> -		val = ISL29028_CONF_PROX_EN;
>  	ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
> -				 ISL29028_CONF_PROX_EN_MASK, val);
> +				 ISL29028_CONF_PROX_EN_MASK,
> +				 ISL29028_CONF_PROX_EN);
>  	if (ret < 0)
>  		return ret;
>  
> @@ -215,7 +213,7 @@ static int isl29028_proxim_get(struct isl29028_chip *chip, int *prox_data)
>  	int ret;
>  
>  	if (!chip->enable_prox) {
> -		ret = isl29028_enable_proximity(chip, true);
> +		ret = isl29028_enable_proximity(chip);
>  		if (ret < 0)
>  			return ret;
>  		chip->enable_prox = true;
> 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 02/19] staging: iio: isl29028: remove enable flag from  isl29028_enable_proximity() Jonathan Cameron <jic23@kernel.org> - 2017-01-08 10:50 +0100
  Re: [PATCH 02/19] staging: iio: isl29028: remove enable flag from  isl29028_enable_proximity() Brian Masney <masneyb@onstation.org> - 2017-01-14 21:10 +0100
    Re: [PATCH 02/19] staging: iio: isl29028: remove enable flag from  isl29028_enable_proximity() Jonathan Cameron <jic23@kernel.org> - 2017-01-15 15:40 +0100

csiph-web