summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-11-01 21:52:26 +0800
committerbernard <[email protected]>2014-11-01 21:52:26 +0800
commita00cc57487f78629bf3aaa7c3c04708af6fa0800 (patch)
tree9ff51facb280baa4d427da3ad05bf07b70782876 /src/device.c
parentc7ee7f9858f2cc86d94a2eea8baacfc449865e9a (diff)
Prepare RT-Thread 1.2.3 release.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c43
1 files changed, 5 insertions, 38 deletions
diff --git a/src/device.c b/src/device.c
index 7ee130041c..2c5ea258ad 100644
--- a/src/device.c
+++ b/src/device.c
@@ -79,45 +79,12 @@ RTM_EXPORT(rt_device_unregister);
* This function initializes all registered device driver
*
* @return the error code, RT_EOK on successfully.
+ *
+ * @deprecated since 1.2.3, this function is not needed because the initialization
+ * of a device is performed when applicaiton opens it.
*/
rt_err_t rt_device_init_all(void)
{
- struct rt_device *device;
- struct rt_list_node *node;
- struct rt_object_information *information;
- register rt_err_t result;
-
- extern struct rt_object_information rt_object_container[];
-
- information = &rt_object_container[RT_Object_Class_Device];
-
- /* for each device */
- for (node = information->object_list.next;
- node != &(information->object_list);
- node = node->next)
- {
- rt_err_t (*init)(rt_device_t dev);
- device = (struct rt_device *)rt_list_entry(node,
- struct rt_object,
- list);
-
- /* get device init handler */
- init = device->init;
- if (init != RT_NULL && !(device->flag & RT_DEVICE_FLAG_ACTIVATED))
- {
- result = init(device);
- if (result != RT_EOK)
- {
- rt_kprintf("To initialize device:%s failed. The error code is %d\n",
- device->parent.name, result);
- }
- else
- {
- device->flag |= RT_DEVICE_FLAG_ACTIVATED;
- }
- }
- }
-
return RT_EOK;
}
@@ -395,8 +362,8 @@ rt_err_t rt_device_control(rt_device_t dev, rt_uint8_t cmd, void *arg)
RTM_EXPORT(rt_device_control);
/**
- * This function will set the indication callback function when device receives
- * data.
+ * This function will set the reception indication callback function. This callback function
+ * is invoked when this device receives data.
*
* @param dev the pointer of device driver structure
* @param rx_ind the indication callback function