summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbernard <[email protected]>2014-07-10 13:34:52 +0800
committerbernard <[email protected]>2014-07-10 13:34:52 +0800
commit1e7b0894949be4fe86c31ddf3c1bd754908459aa (patch)
tree8185513049c8ef9ab1e801708bac0f4fba353aa9 /src
parentd0debf9892c21f04b209e6c837b3e3d0af0598d0 (diff)
[Kernel] Remove rt_device_init_all implemetation.
Diffstat (limited to 'src')
-rw-r--r--src/device.c39
1 files changed, 3 insertions, 36 deletions
diff --git a/src/device.c b/src/device.c
index 7ee130041c..2bb3cc0f9c 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 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;
}