summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-12-20 07:48:59 +0000
committer[email protected] <[email protected]>2012-12-20 07:48:59 +0000
commit7e159dfb763d4d2c961f281bbcc4eb4880a1de41 (patch)
tree8bd6fbd90c829eda08577fea9035f49f9b8232bf /src
parenta810c1ae73b1b5d1e618b9282b196b4212b13ddf (diff)
fixed the coding style in device.c
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2502 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src')
-rw-r--r--src/device.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/device.c b/src/device.c
index 58eda6140b..e55e219307 100644
--- a/src/device.c
+++ b/src/device.c
@@ -79,10 +79,14 @@ rt_err_t rt_device_init_all(void)
information = &rt_object_container[RT_Object_Class_Device];
/* for each device */
- for (node = information->object_list.next; node != &(information->object_list); node = node->next)
+ 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);
+ device = (struct rt_device *)rt_list_entry(node,
+ struct rt_object,
+ list);
/* get device init handler */
init = device->init;
@@ -125,7 +129,9 @@ rt_device_t rt_device_find(const char *name)
/* try to find device object */
information = &rt_object_container[RT_Object_Class_Device];
- for (node = information->object_list.next; node != &(information->object_list); node = node->next)
+ for (node = information->object_list.next;
+ node != &(information->object_list);
+ node = node->next)
{
object = rt_list_entry(node, struct rt_object, list);
if (rt_strncmp(object->name, name, RT_NAME_MAX) == 0)
@@ -158,7 +164,7 @@ rt_err_t rt_device_init(rt_device_t dev)
{
rt_err_t result = RT_EOK;
rt_err_t (*init)(rt_device_t dev);
-
+
RT_ASSERT(dev != RT_NULL);
/* get device init handler */
@@ -221,8 +227,11 @@ rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
}
/* device is a stand alone device and opened */
- if ((dev->flag & RT_DEVICE_FLAG_STANDALONE) && (dev->open_flag & RT_DEVICE_OFLAG_OPEN))
+ if ((dev->flag & RT_DEVICE_FLAG_STANDALONE) &&
+ (dev->open_flag & RT_DEVICE_OFLAG_OPEN))
+ {
return -RT_EBUSY;
+ }
/* call device open interface */
open = dev->open;