]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adc: mcp3422: fix locking scope
authorAngelo Compagnucci <angelo.compagnucci@gmail.com>
Wed, 19 Aug 2020 07:55:25 +0000 (09:55 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 31 Aug 2020 09:47:53 +0000 (10:47 +0100)
commit2d6f9412f5fe916b180a59026d5592a7880bcdad
tree24b50934e355163a167d9f01bc8cc72427e95dd2
parent1bb5f8be650a8470adb436b9ab38842e5dbd3b0c
iio: adc: mcp3422: fix locking scope

Locking should be held for the entire reading sequence involving setting
the channel, waiting for the channel switch and reading from the
channel.
If not, reading from a channel can result mixing with the reading from
another channel.

Fixes: 5e3e939cb24d ("iio: adc: Add driver for Microchip MCP3422/3/4 high resolution ADC")
Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
Link: https://lore.kernel.org/r/20200819075525.1395248-1-angelo.compagnucci@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/mcp3422.c