diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-01-09 12:31:00 -0500 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-02-09 06:08:42 -0500 |
commit | 14543a00fc3ce6dac9f297535c502a0085a50467 (patch) | |
tree | 1c244bcc56bd4a48ee2c305856457d102d6eccbe /drivers/iio/gyro | |
parent | 6d9eecd418afb2c12e5db5be3d72f0f1df43bdd9 (diff) |
iio: Use spi_sync_transfer()
Use the new spi_sync_transfer() helper function instead of open-coding it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/gyro')
-rw-r--r-- | drivers/iio/gyro/adxrs450.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/gyro/adxrs450.c b/drivers/iio/gyro/adxrs450.c index d9d43831c380..5b79953f7011 100644 --- a/drivers/iio/gyro/adxrs450.c +++ b/drivers/iio/gyro/adxrs450.c | |||
@@ -213,7 +213,6 @@ error_ret: | |||
213 | static int adxrs450_spi_initial(struct adxrs450_state *st, | 213 | static int adxrs450_spi_initial(struct adxrs450_state *st, |
214 | u32 *val, char chk) | 214 | u32 *val, char chk) |
215 | { | 215 | { |
216 | struct spi_message msg; | ||
217 | int ret; | 216 | int ret; |
218 | u32 tx; | 217 | u32 tx; |
219 | struct spi_transfer xfers = { | 218 | struct spi_transfer xfers = { |
@@ -228,9 +227,7 @@ static int adxrs450_spi_initial(struct adxrs450_state *st, | |||
228 | if (chk) | 227 | if (chk) |
229 | tx |= (ADXRS450_CHK | ADXRS450_P); | 228 | tx |= (ADXRS450_CHK | ADXRS450_P); |
230 | st->tx = cpu_to_be32(tx); | 229 | st->tx = cpu_to_be32(tx); |
231 | spi_message_init(&msg); | 230 | ret = spi_sync_transfer(st->us, &xfers, 1); |
232 | spi_message_add_tail(&xfers, &msg); | ||
233 | ret = spi_sync(st->us, &msg); | ||
234 | if (ret) { | 231 | if (ret) { |
235 | dev_err(&st->us->dev, "Problem while reading initializing data\n"); | 232 | dev_err(&st->us->dev, "Problem while reading initializing data\n"); |
236 | goto error_ret; | 233 | goto error_ret; |