drivers: i2c_nrfx_twim: clean up when buffer capacity failure detected
Do the normal post-transfer shutdown and sync management when a transaction is rejected due to insufficient buffer size rather than returning with the peripheral left enabled and the transfer lock held. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
d719801d1e
commit
1278c13d47
1 changed files with 2 additions and 1 deletions
|
@ -78,7 +78,8 @@ static int i2c_nrfx_twim_transfer(struct device *dev, struct i2c_msg *msgs,
|
||||||
if ((concat_len + msgs[i].len) > concat_buf_size) {
|
if ((concat_len + msgs[i].len) > concat_buf_size) {
|
||||||
LOG_ERR("concat-buf overflow: %u + %u > %u",
|
LOG_ERR("concat-buf overflow: %u + %u > %u",
|
||||||
concat_len, msgs[i].len, concat_buf_size);
|
concat_len, msgs[i].len, concat_buf_size);
|
||||||
return -ENOSPC;
|
ret = -ENOSPC;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!(msgs[i].flags & I2C_MSG_READ)) {
|
if (!(msgs[i].flags & I2C_MSG_READ)) {
|
||||||
memcpy(concat_buf + concat_len,
|
memcpy(concat_buf + concat_len,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue