mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
i2c: acpi: Use I2C_M_DMA_SAFE in acpi_gsb_i2c_[read|write]_bytes()
The main read / write "buffer" is kzalloc()ed and as such is safe to directly use for DMA (unlike stack mem). Add the I2C_M_DMA_SAFE flag to the transfers using these buffers. Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Acked-by: Mika Westerberg <westeri@kernel.org> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://patch.msgid.link/20260919193642.43058-1-johannes.goede@oss.qualcomm.com
This commit is contained in:
parent
fe87113a9a
commit
09753024bb
|
|
@ -609,7 +609,7 @@ static int acpi_gsb_i2c_read_bytes(struct i2c_client *client,
|
|||
msgs[0].buf = &cmd;
|
||||
|
||||
msgs[1].addr = client->addr;
|
||||
msgs[1].flags = client->flags | I2C_M_RD;
|
||||
msgs[1].flags = client->flags | I2C_M_RD | I2C_M_DMA_SAFE;
|
||||
msgs[1].len = data_len;
|
||||
msgs[1].buf = buffer;
|
||||
|
||||
|
|
@ -650,7 +650,7 @@ static int acpi_gsb_i2c_write_bytes(struct i2c_client *client,
|
|||
memcpy(buffer + 1, data, data_len);
|
||||
|
||||
msgs[0].addr = client->addr;
|
||||
msgs[0].flags = client->flags;
|
||||
msgs[0].flags = client->flags | I2C_M_DMA_SAFE;
|
||||
msgs[0].len = data_len + 1;
|
||||
msgs[0].buf = buffer;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user