Commit 65fc5b7f authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Henrik Brix Andersen
Browse files

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: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent ac49a21c
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -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);

/**
 * @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.
 *
@@ -763,11 +747,6 @@ bool z_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.
 *
+3 −3
Original line number Diff line number Diff line
@@ -40,13 +40,13 @@ const struct device *z_impl_device_get_binding(const char *name)
	 * performed. Reserve string comparisons for a fallback.
	 */
	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;
		}
	}

	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;
		}
	}
@@ -87,7 +87,7 @@ size_t z_device_get_all_static(struct device const **devices)
	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