diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-20 10:37:31 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-07-20 10:37:31 +0300 |
commit | 263771dbc85bc6573b344c193351980c27fd2faa (patch) | |
tree | 0232ad4d61cb06d4d75af183b4c6d2058ba27f34 /drivers/iio/humidity/hdc100x.c | |
parent | 1f491421c4172ac6d97dcd762a07ae40f110cbac (diff) | |
parent | ba47d845d715a010f7b51f6f89bae32845e6acb7 (diff) | |
download | linux-263771dbc85bc6573b344c193351980c27fd2faa.tar.xz |
Merge 5.8-rc6 into staging-next
We need the staging fixes in here, and it resolves a merge issue with an
iio driver.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/humidity/hdc100x.c')
-rw-r--r-- | drivers/iio/humidity/hdc100x.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/iio/humidity/hdc100x.c b/drivers/iio/humidity/hdc100x.c index 257122462825..071cb2b12bb6 100644 --- a/drivers/iio/humidity/hdc100x.c +++ b/drivers/iio/humidity/hdc100x.c @@ -38,6 +38,11 @@ struct hdc100x_data { /* integration time of the sensor */ int adc_int_us[2]; + /* Ensure natural alignment of timestamp */ + struct { + __be16 channels[2]; + s64 ts __aligned(8); + } scan; }; /* integration time in us */ @@ -312,7 +317,6 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) struct i2c_client *client = data->client; int delay = data->adc_int_us[0] + data->adc_int_us[1]; int ret; - s16 buf[8]; /* 2x s16 + padding + 8 byte timestamp */ /* dual read starts at temp register */ mutex_lock(&data->lock); @@ -323,13 +327,13 @@ static irqreturn_t hdc100x_trigger_handler(int irq, void *p) } usleep_range(delay, delay + 1000); - ret = i2c_master_recv(client, (u8 *)buf, 4); + ret = i2c_master_recv(client, (u8 *)data->scan.channels, 4); if (ret < 0) { dev_err(&client->dev, "cannot read sensor data\n"); goto err; } - iio_push_to_buffers_with_timestamp(indio_dev, buf, + iio_push_to_buffers_with_timestamp(indio_dev, &data->scan, iio_get_time_ns(indio_dev)); err: mutex_unlock(&data->lock); |