Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363562
b: refs/heads/master
c: 43bb786
h: refs/heads/master
v: v3
  • Loading branch information
Denis Ciocca authored and Jonathan Cameron committed Mar 16, 2013
1 parent 9c0b173 commit bddd053
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0eac259db28fde88767cab5fd0380f4024e08c02
refs/heads/master: 43bb786ad2886ea38364e57924c19e9d29f37201
11 changes: 2 additions & 9 deletions trunk/drivers/iio/common/st_sensors/st_sensors_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ static unsigned int st_sensors_spi_get_irq(struct iio_dev *indio_dev)
static int st_sensors_spi_read(struct st_sensor_transfer_buffer *tb,
struct device *dev, u8 reg_addr, int len, u8 *data, bool multiread_bit)
{
struct spi_message msg;
int err;

struct spi_transfer xfers[] = {
Expand All @@ -51,10 +50,7 @@ static int st_sensors_spi_read(struct st_sensor_transfer_buffer *tb,
else
tb->tx_buf[0] = reg_addr | ST_SENSORS_SPI_READ;

spi_message_init(&msg);
spi_message_add_tail(&xfers[0], &msg);
spi_message_add_tail(&xfers[1], &msg);
err = spi_sync(to_spi_device(dev), &msg);
err = spi_sync_transfer(to_spi_device(dev), xfers, ARRAY_SIZE(xfers));
if (err)
goto acc_spi_read_error;

Expand Down Expand Up @@ -83,7 +79,6 @@ static int st_sensors_spi_read_multiple_byte(
static int st_sensors_spi_write_byte(struct st_sensor_transfer_buffer *tb,
struct device *dev, u8 reg_addr, u8 data)
{
struct spi_message msg;
int err;

struct spi_transfer xfers = {
Expand All @@ -96,9 +91,7 @@ static int st_sensors_spi_write_byte(struct st_sensor_transfer_buffer *tb,
tb->tx_buf[0] = reg_addr;
tb->tx_buf[1] = data;

spi_message_init(&msg);
spi_message_add_tail(&xfers, &msg);
err = spi_sync(to_spi_device(dev), &msg);
err = spi_sync_transfer(to_spi_device(dev), &xfers, 1);
mutex_unlock(&tb->buf_lock);

return err;
Expand Down

0 comments on commit bddd053

Please sign in to comment.