drivers: counter: Fix incorrect error codes
Unimplemented interfaces should return -ENOSYS instead of -ENOTSUP. Signed-off-by: James Roy <rruuaanng@outlook.com>
This commit is contained in:
parent
d9f3ee4bb0
commit
e38cc894e3
2 changed files with 4 additions and 4 deletions
|
@ -427,7 +427,7 @@ static inline int z_impl_counter_get_value_64(const struct device *dev,
|
|||
(struct counter_driver_api *)dev->api;
|
||||
|
||||
if (!api->get_value_64) {
|
||||
return -ENOTSUP;
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
return api->get_value_64(dev, ticks);
|
||||
|
@ -650,7 +650,7 @@ static inline uint32_t z_impl_counter_get_top_value(const struct device *dev)
|
|||
* @param flags See @ref COUNTER_GUARD_PERIOD_FLAGS.
|
||||
*
|
||||
* @retval 0 if successful.
|
||||
* @retval -ENOTSUP if function or flags are not supported.
|
||||
* @retval -ENOSYS if function or flags are not supported.
|
||||
* @retval -EINVAL if ticks value is invalid.
|
||||
*/
|
||||
__syscall int counter_set_guard_period(const struct device *dev,
|
||||
|
@ -664,7 +664,7 @@ static inline int z_impl_counter_set_guard_period(const struct device *dev,
|
|||
(struct counter_driver_api *)dev->api;
|
||||
|
||||
if (!api->set_guard_period) {
|
||||
return -ENOTSUP;
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
return api->set_guard_period(dev, ticks, flags);
|
||||
|
|
|
@ -882,7 +882,7 @@ static bool late_detection_capable(const struct device *dev)
|
|||
int err = counter_set_guard_period(dev, guard,
|
||||
COUNTER_GUARD_PERIOD_LATE_TO_SET);
|
||||
|
||||
if (err == -ENOTSUP) {
|
||||
if (err == -ENOSYS) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue