device: Remove z_device_is_ready
This duplicates the functionality of device_is_ready. Calls for z_device_is_ready are being done in kernel mode, so it is safe to call its implementation directly. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
ac49a21ccd
commit
65fc5b7f17
2 changed files with 3 additions and 24 deletions
|
@ -729,22 +729,6 @@ __syscall const struct device *device_get_binding(const char *name);
|
||||||
*/
|
*/
|
||||||
size_t z_device_get_all_static(const struct device **devices);
|
size_t z_device_get_all_static(const struct device **devices);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify that a device is ready for use.
|
|
||||||
*
|
|
||||||
* This is the implementation underlying device_is_ready(), without the overhead
|
|
||||||
* of a syscall wrapper.
|
|
||||||
*
|
|
||||||
* @param dev pointer to the device in question.
|
|
||||||
*
|
|
||||||
* @retval true If the device is ready for use.
|
|
||||||
* @retval false If the device is not ready for use or if a NULL device pointer
|
|
||||||
* is passed as argument.
|
|
||||||
*
|
|
||||||
* @see device_is_ready()
|
|
||||||
*/
|
|
||||||
bool z_device_is_ready(const struct device *dev);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Verify that a device is ready for use.
|
* @brief Verify that a device is ready for use.
|
||||||
*
|
*
|
||||||
|
@ -763,11 +747,6 @@ bool z_device_is_ready(const struct device *dev);
|
||||||
*/
|
*/
|
||||||
__syscall 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 z_device_is_ready(dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize a device.
|
* @brief Initialize a device.
|
||||||
*
|
*
|
||||||
|
|
|
@ -40,13 +40,13 @@ const struct device *z_impl_device_get_binding(const char *name)
|
||||||
* performed. Reserve string comparisons for a fallback.
|
* performed. Reserve string comparisons for a fallback.
|
||||||
*/
|
*/
|
||||||
STRUCT_SECTION_FOREACH(device, dev) {
|
STRUCT_SECTION_FOREACH(device, dev) {
|
||||||
if (z_device_is_ready(dev) && (dev->name == name)) {
|
if (z_impl_device_is_ready(dev) && (dev->name == name)) {
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STRUCT_SECTION_FOREACH(device, dev) {
|
STRUCT_SECTION_FOREACH(device, dev) {
|
||||||
if (z_device_is_ready(dev) && (strcmp(name, dev->name) == 0)) {
|
if (z_impl_device_is_ready(dev) && (strcmp(name, dev->name) == 0)) {
|
||||||
return dev;
|
return dev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ size_t z_device_get_all_static(struct device const **devices)
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool z_device_is_ready(const struct device *dev)
|
bool z_impl_device_is_ready(const struct device *dev)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* if an invalid device pointer is passed as argument, this call
|
* if an invalid device pointer is passed as argument, this call
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue