@@ -60,15 +60,15 @@ static int ptm_fops_close(struct dfs_file *file)
60
60
lwp_tty_t tp ;
61
61
rt_device_t device ;
62
62
63
- if (file -> vnode && file -> vnode -> data )
63
+ if (file -> data )
64
64
{
65
65
if (file -> vnode -> ref_count != 1 )
66
66
{
67
67
rc = 0 ;
68
68
}
69
69
else
70
70
{
71
- device = (rt_device_t )file -> vnode -> data ;
71
+ device = (rt_device_t )file -> data ;
72
72
tp = rt_container_of (device , struct lwp_tty , parent );
73
73
rc = bsd_ptsdev_methods .fo_close (tp , rt_thread_self ());
74
74
}
@@ -92,9 +92,9 @@ static ssize_t ptm_fops_read(struct dfs_file *file, void *buf, size_t count,
92
92
struct lwp_tty * tp ;
93
93
int oflags = file -> flags ;
94
94
95
- if (file -> vnode && file -> vnode -> data )
95
+ if (file -> data )
96
96
{
97
- device = (rt_device_t )file -> vnode -> data ;
97
+ device = (rt_device_t )file -> data ;
98
98
tp = rt_container_of (device , struct lwp_tty , parent );
99
99
100
100
/* setup uio parameters */
@@ -133,9 +133,9 @@ static ssize_t ptm_fops_write(struct dfs_file *file, const void *buf,
133
133
struct lwp_tty * tp ;
134
134
int oflags = file -> flags ;
135
135
136
- if (file -> vnode && file -> vnode -> data )
136
+ if (file -> data )
137
137
{
138
- device = (rt_device_t )file -> vnode -> data ;
138
+ device = (rt_device_t )file -> data ;
139
139
tp = rt_container_of (device , struct lwp_tty , parent );
140
140
141
141
/* setup uio parameters */
@@ -172,9 +172,9 @@ static int ptm_fops_ioctl(struct dfs_file *file, int cmd, void *arg)
172
172
rt_device_t device ;
173
173
rt_ubase_t cmd_normal = (unsigned int )cmd ;
174
174
175
- if (file -> vnode && file -> vnode -> data )
175
+ if (file -> data )
176
176
{
177
- device = (rt_device_t )file -> vnode -> data ;
177
+ device = (rt_device_t )file -> data ;
178
178
tp = rt_container_of (device , struct lwp_tty , parent );
179
179
180
180
switch (cmd_normal )
@@ -239,9 +239,9 @@ static int ptm_fops_poll(struct dfs_file *file, struct rt_pollreq *req)
239
239
rt_device_t device ;
240
240
struct lwp_tty * tp ;
241
241
242
- if (file -> vnode && file -> vnode -> data )
242
+ if (file -> data )
243
243
{
244
- device = (rt_device_t )file -> vnode -> data ;
244
+ device = (rt_device_t )file -> data ;
245
245
tp = rt_container_of (device , struct lwp_tty , parent );
246
246
247
247
rc = bsd_ptsdev_methods .fo_poll (tp , req , 0 , rt_thread_self ());
0 commit comments