Commit 7e604a3d authored by Nishant Malpani's avatar Nishant Malpani Committed by Jonathan Cameron

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: 2c8920ff ("iio: gyro: Add driver support for ADXRS290")
Signed-off-by: default avatarNishant Malpani <nish.malpani25@gmail.com>
Link: https://lore.kernel.org/r/20200825124552.11155-1-nish.malpani25@gmail.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 3b0028bd
...@@ -385,6 +385,8 @@ static int adxrs290_probe(struct spi_device *spi) ...@@ -385,6 +385,8 @@ static int adxrs290_probe(struct spi_device *spi)
indio_dev->num_channels = ARRAY_SIZE(adxrs290_channels); indio_dev->num_channels = ARRAY_SIZE(adxrs290_channels);
indio_dev->info = &adxrs290_info; indio_dev->info = &adxrs290_info;
mutex_init(&st->lock);
val = spi_w8r8(spi, ADXRS290_READ_REG(ADXRS290_REG_ADI_ID)); val = spi_w8r8(spi, ADXRS290_READ_REG(ADXRS290_REG_ADI_ID));
if (val != ADXRS290_ADI_ID) { if (val != ADXRS290_ADI_ID) {
dev_err(&spi->dev, "Wrong ADI ID 0x%02x\n", val); dev_err(&spi->dev, "Wrong ADI ID 0x%02x\n", val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment