From 1e7b0894949be4fe86c31ddf3c1bd754908459aa Mon Sep 17 00:00:00 2001 From: bernard Date: Thu, 10 Jul 2014 13:34:52 +0800 Subject: [PATCH] [Kernel] Remove rt_device_init_all implemetation. --- src/device.c | 39 +++------------------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/src/device.c b/src/device.c index 7ee130041..2bb3cc0f9 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; } -- GitLab