summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitja Spes <mitja@lxnav.com>2022-10-21 16:58:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-25 19:45:52 +0300
commit67a75a9480fc4f73465a90e6a5e5ee12e9de4d39 (patch)
treecfa4c17282f114bca8dc15c3245adaee9ffec471
parentd95b85c5084ad70011988861ee864529eefa1da0 (diff)
downloadlinux-67a75a9480fc4f73465a90e6a5e5ee12e9de4d39.tar.xz
iio: pressure: ms5611: changed hardcoded SPI speed to value limited
commit 741cec30cc52058d1c10d415f3b98319887e4f73 upstream. Don't hardcode the ms5611 SPI speed, limit it instead. Signed-off-by: Mitja Spes <mitja@lxnav.com> Fixes: c0644160a8b5 ("iio: pressure: add support for MS5611 pressure and temperature sensor") Link: https://lore.kernel.org/r/20221021135827.1444793-3-mitja@lxnav.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/iio/pressure/ms5611_spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/pressure/ms5611_spi.c b/drivers/iio/pressure/ms5611_spi.c
index 45d3a7d5be8e..f7743ee3318f 100644
--- a/drivers/iio/pressure/ms5611_spi.c
+++ b/drivers/iio/pressure/ms5611_spi.c
@@ -94,7 +94,7 @@ static int ms5611_spi_probe(struct spi_device *spi)
spi_set_drvdata(spi, indio_dev);
spi->mode = SPI_MODE_0;
- spi->max_speed_hz = 20000000;
+ spi->max_speed_hz = min(spi->max_speed_hz, 20000000U);
spi->bits_per_word = 8;
ret = spi_setup(spi);
if (ret < 0)