diff options
author | Denis Ciocca <denis.ciocca@st.com> | 2019-07-19 01:53:52 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-07-28 00:52:06 +0300 |
commit | 1ecd245e0eb23d1c3803474eba75589743d0d1fe (patch) | |
tree | 4bb5bd28226e91b1a69bcb8a6b556dd29a245697 /drivers/iio/magnetometer/st_magn_spi.c | |
parent | 570c2c55ef364ef6aed531e554be4c989fb1a49c (diff) | |
download | linux-1ecd245e0eb23d1c3803474eba75589743d0d1fe.tar.xz |
iio: move 3-wire spi initialization to st_sensors_spi
Some devices need to be configured with special bit in order to
use spi 3-wire. This was done during device identification phase.
Instead, let's move this part as spi specific.
Doing this the check_device_support function becomes a simple
device id check, so let's rename it.
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/magnetometer/st_magn_spi.c')
-rw-r--r-- | drivers/iio/magnetometer/st_magn_spi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/magnetometer/st_magn_spi.c b/drivers/iio/magnetometer/st_magn_spi.c index a3045afc6b53..fbf909bde841 100644 --- a/drivers/iio/magnetometer/st_magn_spi.c +++ b/drivers/iio/magnetometer/st_magn_spi.c @@ -73,7 +73,9 @@ static int st_magn_spi_probe(struct spi_device *spi) mdata = iio_priv(indio_dev); mdata->sensor_settings = (struct st_sensor_settings *)settings; - st_sensors_spi_configure(indio_dev, spi, mdata); + err = st_sensors_spi_configure(indio_dev, spi); + if (err < 0) + return err; err = st_magn_common_probe(indio_dev); if (err < 0) |