Skip to content

Commit ffcd19e

Browse files
dlechjic23
authored andcommitted
iio: pressure: mprls0025pa: use aligned_s64 for timestamp
Follow the pattern of other drivers and use aligned_s64 for the timestamp. This will ensure the struct itself it also 8-byte aligned. While touching this, convert struct mpr_chan to an anonymous struct to consolidate the code a bit to make it easier for future readers. Fixes: 713337d ("iio: pressure: Honeywell mprls0025pa pressure sensor") Signed-off-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250418-iio-more-timestamp-alignment-v2-2-d6a5d2b1c9fe@baylibre.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent e4570f4 commit ffcd19e

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/iio/pressure/mprls0025pa.h

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ struct iio_dev;
3434
struct mpr_data;
3535
struct mpr_ops;
3636

37-
/**
38-
* struct mpr_chan
39-
* @pres: pressure value
40-
* @ts: timestamp
41-
*/
42-
struct mpr_chan {
43-
s32 pres;
44-
s64 ts;
45-
};
46-
4737
enum mpr_func_id {
4838
MPR_FUNCTION_A,
4939
MPR_FUNCTION_B,
@@ -69,6 +59,8 @@ enum mpr_func_id {
6959
* reading in a loop until data is ready
7060
* @completion: handshake from irq to read
7161
* @chan: channel values for buffered mode
62+
* @chan.pres: pressure value
63+
* @chan.ts: timestamp
7264
* @buffer: raw conversion data
7365
*/
7466
struct mpr_data {
@@ -87,7 +79,10 @@ struct mpr_data {
8779
struct gpio_desc *gpiod_reset;
8880
int irq;
8981
struct completion completion;
90-
struct mpr_chan chan;
82+
struct {
83+
s32 pres;
84+
aligned_s64 ts;
85+
} chan;
9186
u8 buffer[MPR_MEASUREMENT_RD_SIZE] __aligned(IIO_DMA_MINALIGN);
9287
};
9388

0 commit comments

Comments
 (0)