提交 daf488ca 编写于 作者: B Bernard Xiong

fix the open_flag initialization issue.

上级 2a9f80d9
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
* provided by Rob <rdent@iinet.net.au> * provided by Rob <rdent@iinet.net.au>
* 2012-12-25 Bernard return RT_EOK if the device interface not exist. * 2012-12-25 Bernard return RT_EOK if the device interface not exist.
* 2013-07-09 Grissiom add ref_count support * 2013-07-09 Grissiom add ref_count support
* 2016-04-02 Bernard fix the open_flag initialization issue.
*/ */
#include <rtthread.h> #include <rtthread.h>
...@@ -53,6 +54,7 @@ rt_err_t rt_device_register(rt_device_t dev, ...@@ -53,6 +54,7 @@ rt_err_t rt_device_register(rt_device_t dev,
rt_object_init(&(dev->parent), RT_Object_Class_Device, name); rt_object_init(&(dev->parent), RT_Object_Class_Device, name);
dev->flag = flags; dev->flag = flags;
dev->ref_count = 0; dev->ref_count = 0;
dev->open_flag = 0;
return RT_EOK; return RT_EOK;
} }
...@@ -80,7 +82,7 @@ RTM_EXPORT(rt_device_unregister); ...@@ -80,7 +82,7 @@ RTM_EXPORT(rt_device_unregister);
* *
* @return the error code, RT_EOK on successfully. * @return the error code, RT_EOK on successfully.
* *
* @deprecated since 1.2.x, this function is not needed because the initialization * @deprecated since 1.2.x, this function is not needed because the initialization
* of a device is performed when applicaiton opens it. * of a device is performed when applicaiton opens it.
*/ */
rt_err_t rt_device_init_all(void) rt_err_t rt_device_init_all(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册