device: implement device_is_ready as syscall

Instead of using device_usable_check() syscall, implement a new syscall
for device_is_ready that uses z_device_is_ready underneath.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-12-23 17:21:41 +01:00 committed by Anas Nashif
commit 47bfb6fb4c
2 changed files with 12 additions and 2 deletions

View file

@ -789,9 +789,11 @@ static inline int z_impl_device_usable_check(const struct device *dev)
* @retval false if the device is not ready for use or if a NULL device pointer
* is passed as argument.
*/
static inline bool device_is_ready(const struct device *dev)
__syscall bool device_is_ready(const struct device *dev);
static inline bool z_impl_device_is_ready(const struct device *dev)
{
return device_usable_check(dev) == 0;
return z_device_is_ready(dev);
}
/**