From b2b8fdf539ec5dc1eb069b716622ccf5abb44e5a Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 23 Dec 2021 17:18:36 +0100 Subject: [PATCH] device: s/z_device_ready/z_device_is_ready Rename z_device_ready to z_device_is_ready. Function name suggests a boolean result this way, in line with other functions (e.g. device_is_ready). Signed-off-by: Gerard Marull-Paretas --- include/device.h | 4 ++-- kernel/device.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/device.h b/include/device.h index db281421d7d..ecb8be50f4a 100644 --- a/include/device.h +++ b/include/device.h @@ -739,7 +739,7 @@ size_t z_device_get_all_static(const struct device * *devices); * * @return true if and only if the device is available for use. */ -bool z_device_ready(const struct device *dev); +bool z_device_is_ready(const struct device *dev); /** @brief Determine whether a device is ready for use * @@ -752,7 +752,7 @@ bool z_device_ready(const struct device *dev); */ static inline int z_device_usable_check(const struct device *dev) { - return z_device_ready(dev) ? 0 : -ENODEV; + return z_device_is_ready(dev) ? 0 : -ENODEV; } /** @brief Determine whether a device is ready for use. diff --git a/kernel/device.c b/kernel/device.c index cfd2551ad36..72ba96834ce 100644 --- a/kernel/device.c +++ b/kernel/device.c @@ -106,13 +106,13 @@ const struct device *z_impl_device_get_binding(const char *name) * performed. Reserve string comparisons for a fallback. */ for (dev = __device_start; dev != __device_end; dev++) { - if (z_device_ready(dev) && (dev->name == name)) { + if (z_device_is_ready(dev) && (dev->name == name)) { return dev; } } for (dev = __device_start; dev != __device_end; dev++) { - if (z_device_ready(dev) && (strcmp(name, dev->name) == 0)) { + if (z_device_is_ready(dev) && (strcmp(name, dev->name) == 0)) { return dev; } } @@ -149,7 +149,7 @@ size_t z_device_get_all_static(struct device const **devices) return __device_end - __device_start; } -bool z_device_ready(const struct device *dev) +bool z_device_is_ready(const struct device *dev) { /* * if an invalid device pointer is passed as argument, this call