Skip to contentSkip to conversation

iio: gyro: adxrs290: Insert missing mutex initialization call

PATCH In review Nishant Malpani 2 participants 2 messages Aug 25, 2020 – Aug 29, 2020

Subsystems (3)
lore
Share & tools
lore

Nishant Malpani

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 drivers/iio/gyro/adxrs290.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/gyro/adxrs290.c +2 -0
index 38bab4e3eee9..ff989536d2fb 100644
@@ -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);
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 5 lines · On Tue, 25 Aug 2020 18:15:52 +0530 Nishant Malpani <[email protected]>…

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

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it

Thanks,

Jonathan

Quoted 17 lines
---
 drivers/iio/gyro/adxrs290.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/iio/gyro/adxrs290.c +2 -0
index 38bab4e3eee9..ff989536d2fb 100644
@@ -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);