summaryrefslogtreecommitdiff
path: root/drivers/iio/pressure/mpl3115.c
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2020-12-30 23:59:22 +0200
committerMichael Bestas <mkbestas@lineageos.org>2020-12-30 23:59:22 +0200
commit8bca2095c58bfc17532ab9a6259d341decee1288 (patch)
tree6d6fe55982d5b77d369095408ab60797bf9ed4cb /drivers/iio/pressure/mpl3115.c
parent96d93de231c6f2e261efe1307c0e9d23d62f3075 (diff)
parent300d539b8e6e297ffd986afec63a88415eced57d (diff)
Merge branch 'android-4.4-p' of https://android.googlesource.com/kernel/common into lineage-18.1-caf-msm8998
This brings LA.UM.9.2.r1-01800-SDMxx0.0 up to date with https://android.googlesource.com/kernel/common/ android-4.4-p at commit: 300d539b8e6e2 ANDROID: usb: f_accessory: Wrap '_acc_dev' in get()/put() accessors Conflicts: drivers/usb/gadget/function/f_accessory.c include/linux/spi/spi.h Change-Id: Ifef5bfcb9d92b6d560126f0216369c567476f55d
Diffstat (limited to 'drivers/iio/pressure/mpl3115.c')
-rw-r--r--drivers/iio/pressure/mpl3115.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/iio/pressure/mpl3115.c b/drivers/iio/pressure/mpl3115.c
index 0f5b8767ec2e..6ed4e6902eff 100644
--- a/drivers/iio/pressure/mpl3115.c
+++ b/drivers/iio/pressure/mpl3115.c
@@ -139,7 +139,14 @@ static irqreturn_t mpl3115_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct mpl3115_data *data = iio_priv(indio_dev);
- u8 buffer[16]; /* 32-bit channel + 16-bit channel + padding + ts */
+ /*
+ * 32-bit channel + 16-bit channel + padding + ts
+ * Note that it is possible for only one of the first 2
+ * channels to be enabled. If that happens, the first element
+ * of the buffer may be either 16 or 32-bits. As such we cannot
+ * use a simple structure definition to express this data layout.
+ */
+ u8 buffer[16] __aligned(8);
int ret, pos = 0;
mutex_lock(&data->lock);