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


Groups > linux.kernel > #1605090

Re: [PATCH v3] staging: ad7606: Replace mlock with driver private lock

From Lars-Peter Clausen <lars@metafoo.de>
Newsgroups linux.kernel
Subject Re: [PATCH v3] staging: ad7606: Replace mlock with driver private lock
Date 2017-03-20 20:40 +0100
Message-ID <tnbjP-VN-3@gated-at.bofh.it> (permalink)
References <tnaH8-qZ-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 03/20/2017 07:56 PM, Arushi Singhal wrote:
[...]
> @@ -413,6 +413,7 @@ int ad7606_probe(struct device *dev, int irq, void __iomem *base_address,
>  	st = iio_priv(indio_dev);
>  
>  	st->dev = dev;
> +	mutex_init(&st->lock);

This is nitpicking, but putting this in the middle of the assignments has a
bit of a weired flow it. Either put it above or below the assignments.

>  	st->bops = bops;
>  	st->base_address = base_address;
>  	/* tied to logic low, analog input range is +/- 5V */
> diff --git a/drivers/staging/iio/adc/ad7606.h b/drivers/staging/iio/adc/ad7606.h
> index 746f9553d2ba..5d59bdd78727 100644
> --- a/drivers/staging/iio/adc/ad7606.h
> +++ b/drivers/staging/iio/adc/ad7606.h
> @@ -14,6 +14,7 @@
>   * @name:		identification string for chip
>   * @channels:		channel specification
>   * @num_channels:	number of channels
> + * @lock		protect sensor state

This documentation is for struct ad7607_chip_info, but you are adding the
field to struct ad7606_state.

>   */
>  
>  struct ad7606_chip_info {
> @@ -37,6 +38,7 @@ struct ad7606_state {
>  	bool				done;
>  	void __iomem			*base_address;
>  
> +	struct mutex			lock; /* protect sensor state */
>  	struct gpio_desc		*gpio_convst;
>  	struct gpio_desc		*gpio_reset;
>  	struct gpio_desc		*gpio_range;
> 

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


Thread

[PATCH v3] staging: ad7606: Replace mlock with driver private lock Arushi Singhal <arushisinghal19971997@gmail.com> - 2017-03-20 20:00 +0100
  Re: [PATCH v3] staging: ad7606: Replace mlock with driver private  lock Lars-Peter Clausen <lars@metafoo.de> - 2017-03-20 20:40 +0100

csiph-web