drivers: watchdog: update API to reflect additional return code

Allow feed operations that would stall due to internal peripheral
delays to complete immediately with -EAGAIN indicating that the feed
did not occur as expected.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-07-07 10:45:44 -05:00 committed by Anas Nashif
commit a0f025995d
2 changed files with 8 additions and 0 deletions

View file

@ -41,6 +41,11 @@ API Changes
:ref:`experimental stability <api_lifecycle>`. See :ref:`util_api` for an API :ref:`experimental stability <api_lifecycle>`. See :ref:`util_api` for an API
reference. reference.
* The :c:func:`wdt_feed` function will now return ``-EAGAIN`` if
issuing a feed would stall the caller. Application code may need to
ignore this diagnostic result or initiate another feed operation
later.
Deprecated in this release Deprecated in this release
========================== ==========================

View file

@ -231,6 +231,9 @@ static inline int wdt_install_timeout(struct device *dev,
* @param channel_id Index of the fed channel. * @param channel_id Index of the fed channel.
* *
* @retval 0 If successful. * @retval 0 If successful.
* @retval -EAGAIN If completing the feed operation would stall the
* caller, for example due to an in-progress watchdog
* operation such as a previous @c wdt_feed().
* @retval -EINVAL If there is no installed timeout for supplied channel. * @retval -EINVAL If there is no installed timeout for supplied channel.
*/ */
__syscall int wdt_feed(struct device *dev, int channel_id); __syscall int wdt_feed(struct device *dev, int channel_id);