drivers/sensors: update nbuffer after initialization

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-06-01 14:55:38 +08:00 committed by Xiang Xiao
parent ef9a02f51c
commit 6b6666ee50
1 changed files with 7 additions and 1 deletions

View File

@ -1151,7 +1151,13 @@ static int sensor_rpmsg_publish_handler(FAR struct rpmsg_endpoint *ept,
ret = file_open(&file, dev->path, SENSOR_REMOTE | O_CLOEXEC);
if (ret >= 0)
{
file_ioctl(&file, SNIOC_SET_BUFFER_NUMBER, cell->nbuffer);
ret = file_ioctl(&file, SNIOC_SET_BUFFER_NUMBER,
cell->nbuffer);
if (ret >= 0)
{
dev->lower.nbuffer = cell->nbuffer;
}
file_close(&file);
}
}