diff options
author | Nishant Malpani <nish.malpani25@gmail.com> | 2020-08-25 18:15:52 +0530 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2020-09-03 19:40:51 +0100 |
commit | 7e604a3d212ca006802f485f7bac9712a5ddd805 (patch) | |
tree | 39f28bb169a0ed27a8b4264cc3273d13e247bdd9 /drivers/iio/gyro | |
parent | 3b0028bd0f03fa60c586cd8c4a6c8265a81dcf9c (diff) | |
download | linux-7e604a3d212ca006802f485f7bac9712a5ddd805.tar.bz2 |
iio: gyro: adxrs290: Insert missing mutex initialization call
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>
Link: https://lore.kernel.org/r/20200825124552.11155-1-nish.malpani25@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r-- | drivers/iio/gyro/adxrs290.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |