@@ -84,12 +84,9 @@ ssize_t pcd_read(struct file *filp, char __user *buff, size_t count, loff_t *f_p
84
84
85
85
/*copy to user */
86
86
if (copy_to_user (buff ,& device_buffer [* f_pos ],count )){
87
- mutex_unlock (& pcd_mutex_lock );
87
+ mutex_unlock (& pcd_mutex_lock );
88
88
return - EFAULT ;
89
89
}
90
-
91
- else {
92
-
93
90
/*update the current file postion */
94
91
* f_pos += count ;
95
92
@@ -102,7 +99,6 @@ ssize_t pcd_read(struct file *filp, char __user *buff, size_t count, loff_t *f_p
102
99
/*Return number of bytes which have been successfully read */
103
100
return count ;
104
101
}
105
- }
106
102
107
103
ssize_t pcd_write (struct file * filp , const char __user * buff , size_t count , loff_t * f_pos )
108
104
{
@@ -127,12 +123,9 @@ ssize_t pcd_write(struct file *filp, const char __user *buff, size_t count, loff
127
123
128
124
/*copy from user */
129
125
if (copy_from_user (& device_buffer [* f_pos ],buff ,count )){
130
- mutex_unlock (& pcd_mutex_lock );
126
+ mutex_unlock (& pcd_mutex_lock );
131
127
return - EFAULT ;
132
128
}
133
-
134
- else {
135
-
136
129
/*update the current file postion */
137
130
* f_pos += count ;
138
131
@@ -145,7 +138,6 @@ ssize_t pcd_write(struct file *filp, const char __user *buff, size_t count, loff
145
138
/*Return number of bytes which have been successfully written */
146
139
return count ;
147
140
}
148
- }
149
141
150
142
int pcd_open (struct inode * inode , struct file * filp )
151
143
{
0 commit comments