linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] iio: gyro: adxrs290: Insert missing mutex initialization call
@ 2020-08-25 12:45 Nishant Malpani
  2020-08-29 16:25 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Nishant Malpani @ 2020-08-25 12:45 UTC (permalink / raw)
  To: jic23
  Cc: dragos.bogdan, darius.berghe, linux-kernel, linux-iio, Nishant Malpani

Insert a missing mutex_init() call during the probe that initializes
the driver's local lock to unlocked state.

Fixes: 2c8920fff145 ("iio: gyro: Add driver support for ADXRS290")
Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
---
 drivers/iio/gyro/adxrs290.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/gyro/adxrs290.c b/drivers/iio/gyro/adxrs290.c
index 38bab4e3eee9..ff989536d2fb 100644
--- a/drivers/iio/gyro/adxrs290.c
+++ b/drivers/iio/gyro/adxrs290.c
@@ -385,6 +385,8 @@ static int adxrs290_probe(struct spi_device *spi)
 	indio_dev->num_channels = ARRAY_SIZE(adxrs290_channels);
 	indio_dev->info = &adxrs290_info;
 
+	mutex_init(&st->lock);
+
 	val = spi_w8r8(spi, ADXRS290_READ_REG(ADXRS290_REG_ADI_ID));
 	if (val != ADXRS290_ADI_ID) {
 		dev_err(&spi->dev, "Wrong ADI ID 0x%02x\n", val);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] iio: gyro: adxrs290: Insert missing mutex initialization call
  2020-08-25 12:45 [PATCH 1/1] iio: gyro: adxrs290: Insert missing mutex initialization call Nishant Malpani
@ 2020-08-29 16:25 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2020-08-29 16:25 UTC (permalink / raw)
  To: Nishant Malpani; +Cc: dragos.bogdan, darius.berghe, linux-kernel, linux-iio

On Tue, 25 Aug 2020 18:15:52 +0530
Nishant Malpani <nish.malpani25@gmail.com> wrote:

> Insert a missing mutex_init() call during the probe that initializes
> the driver's local lock to unlocked state.
> 
> Fixes: 2c8920fff145 ("iio: gyro: Add driver support for ADXRS290")
> Signed-off-by: Nishant Malpani <nish.malpani25@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it

Thanks,

Jonathan

> ---
>  drivers/iio/gyro/adxrs290.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/iio/gyro/adxrs290.c b/drivers/iio/gyro/adxrs290.c
> index 38bab4e3eee9..ff989536d2fb 100644
> --- a/drivers/iio/gyro/adxrs290.c
> +++ b/drivers/iio/gyro/adxrs290.c
> @@ -385,6 +385,8 @@ static int adxrs290_probe(struct spi_device *spi)
>  	indio_dev->num_channels = ARRAY_SIZE(adxrs290_channels);
>  	indio_dev->info = &adxrs290_info;
>  
> +	mutex_init(&st->lock);
> +
>  	val = spi_w8r8(spi, ADXRS290_READ_REG(ADXRS290_REG_ADI_ID));
>  	if (val != ADXRS290_ADI_ID) {
>  		dev_err(&spi->dev, "Wrong ADI ID 0x%02x\n", val);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-29 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 12:45 [PATCH 1/1] iio: gyro: adxrs290: Insert missing mutex initialization call Nishant Malpani
2020-08-29 16:25 ` Jonathan Cameron

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).