diff options
| author | Bernard Xiong <[email protected]> | 2016-04-02 14:42:38 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2016-04-02 14:42:38 +0800 |
| commit | daf488ca7736b4fb940277121f852c3037e26934 (patch) | |
| tree | d2c9f2f066eb07baa77e4f3abe5d02065b60b9b4 /src/device.c | |
| parent | 2a9f80d9474d7f760d51710a3262e60dc954c03e (diff) | |
fix the open_flag initialization issue.
Diffstat (limited to 'src/device.c')
| -rw-r--r-- | src/device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c index 957c9fc774..1175a340c9 100644 --- a/src/device.c +++ b/src/device.c @@ -25,6 +25,7 @@ * provided by Rob <[email protected]> * 2012-12-25 Bernard return RT_EOK if the device interface not exist. * 2013-07-09 Grissiom add ref_count support + * 2016-04-02 Bernard fix the open_flag initialization issue. */ #include <rtthread.h> @@ -53,6 +54,7 @@ rt_err_t rt_device_register(rt_device_t dev, rt_object_init(&(dev->parent), RT_Object_Class_Device, name); dev->flag = flags; dev->ref_count = 0; + dev->open_flag = 0; return RT_EOK; } @@ -80,7 +82,7 @@ RTM_EXPORT(rt_device_unregister); * * @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. */ rt_err_t rt_device_init_all(void) |
