Code Review
/
kvmfornfv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git]
/
kernel
/
drivers
/
staging
/
iio
/
gyro
/
adis16060_core.c
diff --git
a/kernel/drivers/staging/iio/gyro/adis16060_core.c
b/kernel/drivers/staging/iio/gyro/adis16060_core.c
index
4c5869d
..
ab816a2
100644
(file)
--- a/
kernel/drivers/staging/iio/gyro/adis16060_core.c
+++ b/
kernel/drivers/staging/iio/gyro/adis16060_core.c
@@
-67,7
+67,7
@@
static int adis16060_spi_read(struct iio_dev *indio_dev, u16 *val)
* starts to place data MSB first on the DOUT line at
* the 6th falling edge of SCLK
*/
* starts to place data MSB first on the DOUT line at
* the 6th falling edge of SCLK
*/
- if (
ret == 0
)
+ if (
!ret
)
*val = ((st->buf[0] & 0x3) << 12) |
(st->buf[1] << 4) |
((st->buf[2] >> 4) & 0xF);
*val = ((st->buf[0] & 0x3) << 12) |
(st->buf[1] << 4) |
((st->buf[2] >> 4) & 0xF);
@@
-89,11
+89,13
@@
static int adis16060_read_raw(struct iio_dev *indio_dev,
/* Take the iio_dev status lock */
mutex_lock(&indio_dev->mlock);
ret = adis16060_spi_write(indio_dev, chan->address);
/* Take the iio_dev status lock */
mutex_lock(&indio_dev->mlock);
ret = adis16060_spi_write(indio_dev, chan->address);
- if (ret < 0) {
- mutex_unlock(&indio_dev->mlock);
- return ret;
- }
+ if (ret < 0)
+ goto out_unlock;
+
ret = adis16060_spi_read(indio_dev, &tval);
ret = adis16060_spi_read(indio_dev, &tval);
+ if (ret < 0)
+ goto out_unlock;
+
mutex_unlock(&indio_dev->mlock);
*val = tval;
return IIO_VAL_INT;
mutex_unlock(&indio_dev->mlock);
*val = tval;
return IIO_VAL_INT;
@@
-108,6
+110,10
@@
static int adis16060_read_raw(struct iio_dev *indio_dev,
}
return -EINVAL;
}
return -EINVAL;
+
+out_unlock:
+ mutex_unlock(&indio_dev->mlock);
+ return ret;
}
static const struct iio_info adis16060_info = {
}
static const struct iio_info adis16060_info = {
@@
-202,7
+208,6
@@
static int adis16060_w_remove(struct spi_device *spi)
static struct spi_driver adis16060_r_driver = {
.driver = {
.name = "adis16060_r",
static struct spi_driver adis16060_r_driver = {
.driver = {
.name = "adis16060_r",
- .owner = THIS_MODULE,
},
.probe = adis16060_r_probe,
};
},
.probe = adis16060_r_probe,
};
@@
-210,7
+215,6
@@
static struct spi_driver adis16060_r_driver = {
static struct spi_driver adis16060_w_driver = {
.driver = {
.name = "adis16060_w",
static struct spi_driver adis16060_w_driver = {
.driver = {
.name = "adis16060_w",
- .owner = THIS_MODULE,
},
.probe = adis16060_w_probe,
.remove = adis16060_w_remove,
},
.probe = adis16060_w_probe,
.remove = adis16060_w_remove,