drivers: sensors: rtio
Inform the executor of a submissions completion with -ENOMEM if the size of the workq is not big enough. Signed-off-by: Florian Weber <Florian.Weber@live.de>
This commit is contained in:
parent
60a2d7d7d2
commit
0d9cdf0990
7 changed files with 42 additions and 7 deletions
|
|
@ -48,7 +48,12 @@ void akm09918c_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe
|
||||||
{
|
{
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, akm09918c_submit_sync);
|
rtio_work_req_submit(req, iodev_sqe, akm09918c_submit_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -444,7 +444,12 @@ static void bma4xx_submit(const struct device *dev, struct rtio_iodev_sqe *iodev
|
||||||
{
|
{
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, bma4xx_submit_sync);
|
rtio_work_req_submit(req, iodev_sqe, bma4xx_submit_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,12 @@ void bme280_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
|
||||||
{
|
{
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, bme280_submit_sync);
|
rtio_work_req_submit(req, iodev_sqe, bme280_submit_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,12 @@ static void sensor_submit_fallback(const struct device *dev, struct rtio_iodev_s
|
||||||
{
|
{
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, sensor_submit_fallback_sync);
|
rtio_work_req_submit(req, iodev_sqe, sensor_submit_fallback_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,12 @@ void mmc56x3_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
|
||||||
{
|
{
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, mmc56x3_submit_sync);
|
rtio_work_req_submit(req, iodev_sqe, mmc56x3_submit_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,12 @@ void icm42688_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
|
||||||
{
|
{
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, icm42688_submit_sync);
|
rtio_work_req_submit(req, iodev_sqe, icm42688_submit_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,12 @@ void spi_rtio_iodev_default_submit(const struct device *dev,
|
||||||
|
|
||||||
struct rtio_work_req *req = rtio_work_req_alloc();
|
struct rtio_work_req *req = rtio_work_req_alloc();
|
||||||
|
|
||||||
__ASSERT_NO_MSG(req);
|
if (req == NULL) {
|
||||||
|
LOG_ERR("RTIO work item allocation failed. Consider to increase "
|
||||||
|
"CONFIG_RTIO_WORKQ_POOL_ITEMS.");
|
||||||
|
rtio_iodev_sqe_err(iodev_sqe, -ENOMEM);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rtio_work_req_submit(req, iodev_sqe, spi_rtio_iodev_default_submit_sync);
|
rtio_work_req_submit(req, iodev_sqe, spi_rtio_iodev_default_submit_sync);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue