Merge tag 'staging-5.7-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[sfrench/cifs-2.6.git] / drivers / staging / iio / resolver / ad2s1210.c
index 4b25a3a314edbc23af483024335e89251834e388..ed404355ea4c6f9978c941a953a014dd21f4f4fe 100644 (file)
@@ -130,17 +130,24 @@ static int ad2s1210_config_write(struct ad2s1210_state *st, u8 data)
 static int ad2s1210_config_read(struct ad2s1210_state *st,
                                unsigned char address)
 {
-       struct spi_transfer xfer = {
-               .len = 2,
-               .rx_buf = st->rx,
-               .tx_buf = st->tx,
+       struct spi_transfer xfers[] = {
+               {
+                       .len = 1,
+                       .rx_buf = &st->rx[0],
+                       .tx_buf = &st->tx[0],
+                       .cs_change = 1,
+               }, {
+                       .len = 1,
+                       .rx_buf = &st->rx[1],
+                       .tx_buf = &st->tx[1],
+               },
        };
        int ret = 0;
 
        ad2s1210_set_mode(MOD_CONFIG, st);
        st->tx[0] = address | AD2S1210_MSB_IS_HIGH;
        st->tx[1] = AD2S1210_REG_FAULT;
-       ret = spi_sync_transfer(st->sdev, &xfer, 1);
+       ret = spi_sync_transfer(st->sdev, xfers, 2);
        if (ret < 0)
                return ret;