summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel/sca3000_core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-11 17:58:02 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-11 17:58:02 (GMT)
commitad463ac42771a0bb8a706cf8a985788fe5f5c1c6 (patch)
treed8585ea49108c4d73af97b75b3ffdc0d094b68ee /drivers/staging/iio/accel/sca3000_core.c
parent5305d746054d1c73e7e9263b25189dedefb2dc01 (diff)
parent09a642b78523e9f4c5970c806ad218aa3de31551 (diff)
downloadlinux-fsl-qoriq-ad463ac42771a0bb8a706cf8a985788fe5f5c1c6.tar.xz
Merge tag 'iio-for-3.9d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes: "4th set of IIO new drivers cleanups and fixes for the 3.9 cycle + a new spi helper function. 1) Introduce spi_sync_transfer and use it within IIO. Originally it was envisioned that this nice little boilerplate replacement would go through the spi tree, but Grant Likely stated he'd prefer we take it through IIO as the example usecases were all in IIO (and are also in this pull request). Note that given their may have been some unresolved elements related to the coccinelle element of the patch, that has been stripped out and will doubtlessly follow at a later date (along with lots of other patches for drivers elsewhere in the tree). 2) New Invensense MPU6050 driver. This is stripped down to pretty much the basics from the original submission with the intent to build up all the fancy bits in an incremental (and hence reviewable fashion). It's been through a good few revisions so nice to finally merge this. 3) Change to iio_channel_get api to simplify device tree based mappings. The actual mappings are currently under review. 4) Build fixes for !CONFIG_IIO_TRIGGER in the st_sensors driver. This one snuck past during review and testing but got picked up by Randy Dunlap in a randconfig build. 5) Some max1363 cleanups and enhancements. 6) Some comment fixes to make them coherent and comprehensible. 7) Trivial build warning fix in mxs-lradc"
Diffstat (limited to 'drivers/staging/iio/accel/sca3000_core.c')
-rw-r--r--drivers/staging/iio/accel/sca3000_core.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/staging/iio/accel/sca3000_core.c b/drivers/staging/iio/accel/sca3000_core.c
index 414d3ca..14683f5 100644
--- a/drivers/staging/iio/accel/sca3000_core.c
+++ b/drivers/staging/iio/accel/sca3000_core.c
@@ -90,7 +90,6 @@ int sca3000_read_data_short(struct sca3000_state *st,
uint8_t reg_address_high,
int len)
{
- struct spi_message msg;
struct spi_transfer xfer[2] = {
{
.len = 1,
@@ -101,11 +100,8 @@ int sca3000_read_data_short(struct sca3000_state *st,
}
};
st->tx[0] = SCA3000_READ_REG(reg_address_high);
- spi_message_init(&msg);
- spi_message_add_tail(&xfer[0], &msg);
- spi_message_add_tail(&xfer[1], &msg);
- return spi_sync(st->us, &msg);
+ return spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer));
}
/**
@@ -133,7 +129,6 @@ static int sca3000_reg_lock_on(struct sca3000_state *st)
**/
static int __sca3000_unlock_reg_lock(struct sca3000_state *st)
{
- struct spi_message msg;
struct spi_transfer xfer[3] = {
{
.len = 2,
@@ -154,12 +149,8 @@ static int __sca3000_unlock_reg_lock(struct sca3000_state *st)
st->tx[3] = 0x50;
st->tx[4] = SCA3000_WRITE_REG(SCA3000_REG_ADDR_UNLOCK);
st->tx[5] = 0xA0;
- spi_message_init(&msg);
- spi_message_add_tail(&xfer[0], &msg);
- spi_message_add_tail(&xfer[1], &msg);
- spi_message_add_tail(&xfer[2], &msg);
- return spi_sync(st->us, &msg);
+ return spi_sync_transfer(st->us, xfer, ARRAY_SIZE(xfer));
}
/**