Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8e791974
Commit
8e791974
authored
Feb 26, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
usb serial drivers:
- removed all usage of port->sem as the usb serial core now does this.
parent
5faeb88a
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
3 additions
and
152 deletions
+3
-152
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/belkin_sa.c
+0
-8
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cyberjack.c
+2
-17
drivers/usb/serial/empeg.c
drivers/usb/serial/empeg.c
+0
-21
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.c
+0
-13
drivers/usb/serial/ir-usb.c
drivers/usb/serial/ir-usb.c
+0
-8
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan.c
+0
-5
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/keyspan_pda.c
+0
-9
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kl5kusb105.c
+1
-27
drivers/usb/serial/mct_u232.c
drivers/usb/serial/mct_u232.c
+0
-15
drivers/usb/serial/omninet.c
drivers/usb/serial/omninet.c
+0
-9
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.c
+0
-9
drivers/usb/serial/whiteheat.c
drivers/usb/serial/whiteheat.c
+0
-11
No files found.
drivers/usb/serial/belkin_sa.c
View file @
8e791974
...
...
@@ -207,8 +207,6 @@ static int belkin_sa_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -230,8 +228,6 @@ static int belkin_sa_open (struct usb_serial_port *port, struct file *filp)
}
exit:
up
(
&
port
->
sem
);
return
retval
;
}
/* belkin_sa_open */
...
...
@@ -249,8 +245,6 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -262,8 +256,6 @@ static void belkin_sa_close (struct usb_serial_port *port, struct file *filp)
}
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
/* belkin_sa_close */
...
...
drivers/usb/serial/cyberjack.c
View file @
8e791974
...
...
@@ -151,8 +151,6 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -179,8 +177,6 @@ static int cyberjack_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" - usb_submit_urb(int urb)"
);
}
up
(
&
port
->
sem
);
return
result
;
}
...
...
@@ -188,8 +184,6 @@ static void cyberjack_close (struct usb_serial_port *port, struct file *filp)
{
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -201,8 +195,6 @@ static void cyberjack_close (struct usb_serial_port *port, struct file *filp)
}
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
static
int
cyberjack_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
...
...
@@ -225,8 +217,6 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
return
(
0
);
}
down
(
&
port
->
sem
);
if
(
(
count
+
priv
->
wrfilled
)
>
sizeof
(
priv
->
wrbuf
)
)
{
/* To much data for buffer. Reset buffer. */
priv
->
wrfilled
=
0
;
...
...
@@ -235,8 +225,9 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* Copy data */
if
(
from_user
)
{
if
(
copy_from_user
(
priv
->
wrbuf
+
priv
->
wrfilled
,
buf
,
count
))
if
(
copy_from_user
(
priv
->
wrbuf
+
priv
->
wrfilled
,
buf
,
count
))
{
return
-
EFAULT
;
}
}
else
{
memcpy
(
priv
->
wrbuf
+
priv
->
wrfilled
,
buf
,
count
);
}
...
...
@@ -277,7 +268,6 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
/* Throw away data. No better idea what to do with it. */
priv
->
wrfilled
=
0
;
priv
->
wrsent
=
0
;
up
(
&
port
->
sem
);
return
0
;
}
...
...
@@ -292,7 +282,6 @@ static int cyberjack_write (struct usb_serial_port *port, int from_user, const u
}
}
up
(
&
port
->
sem
);
return
(
count
);
}
...
...
@@ -432,8 +421,6 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
return
;
}
down
(
&
port
->
sem
);
dbg
(
__FUNCTION__
" - transmitting data (frame n)"
);
length
=
((
priv
->
wrfilled
-
priv
->
wrsent
)
>
port
->
bulk_out_size
)
?
...
...
@@ -459,7 +446,6 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
/* Throw away data. No better idea what to do with it. */
priv
->
wrfilled
=
0
;
priv
->
wrsent
=
0
;
up
(
&
port
->
sem
);
queue_task
(
&
port
->
tqueue
,
&
tq_immediate
);
mark_bh
(
IMMEDIATE_BH
);
return
;
...
...
@@ -477,7 +463,6 @@ static void cyberjack_write_bulk_callback (struct urb *urb)
priv
->
wrsent
=
0
;
}
up
(
&
port
->
sem
);
queue_task
(
&
port
->
tqueue
,
&
tq_immediate
);
mark_bh
(
IMMEDIATE_BH
);
return
;
...
...
drivers/usb/serial/empeg.c
View file @
8e791974
...
...
@@ -157,8 +157,6 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -189,8 +187,6 @@ static int empeg_open (struct usb_serial_port *port, struct file *filp)
}
up
(
&
port
->
sem
);
return
result
;
}
...
...
@@ -208,8 +204,6 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp)
if
(
!
serial
)
return
;
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -220,8 +214,6 @@ static void empeg_close (struct usb_serial_port *port, struct file * filp)
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
/* Uncomment the following line if you want to see some statistics in your syslog */
/* info ("Bytes In = %d Bytes Out = %d", bytes_in, bytes_out); */
}
...
...
@@ -462,15 +454,7 @@ static void empeg_read_bulk_callback (struct urb *urb)
static
void
empeg_throttle
(
struct
usb_serial_port
*
port
)
{
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
usb_unlink_urb
(
port
->
read_urb
);
up
(
&
port
->
sem
);
return
;
}
...
...
@@ -480,8 +464,6 @@ static void empeg_unthrottle (struct usb_serial_port *port)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
port
->
read_urb
->
dev
=
port
->
serial
->
dev
;
result
=
usb_submit_urb
(
port
->
read_urb
,
GFP_KERNEL
);
...
...
@@ -489,10 +471,7 @@ static void empeg_unthrottle (struct usb_serial_port *port)
if
(
result
)
err
(
__FUNCTION__
" - failed submitting read urb, error %d"
,
result
);
up
(
&
port
->
sem
);
return
;
}
...
...
drivers/usb/serial/ftdi_sio.c
View file @
8e791974
...
...
@@ -319,8 +319,6 @@ static int ftdi_sio_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
){
...
...
@@ -361,7 +359,6 @@ static int ftdi_sio_open (struct usb_serial_port *port, struct file *filp)
err
(
__FUNCTION__
" - failed submitting read urb, error %d"
,
result
);
}
up
(
&
port
->
sem
);
return
result
;
}
/* ftdi_sio_open */
...
...
@@ -374,7 +371,6 @@ static void ftdi_sio_close (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
);
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -411,9 +407,6 @@ static void ftdi_sio_close (struct usb_serial_port *port, struct file *filp)
tty_hangup
(
port
->
tty
);
}
}
up
(
&
port
->
sem
);
}
/* ftdi_sio_close */
...
...
@@ -447,8 +440,6 @@ static int ftdi_sio_write (struct usb_serial_port *port, int from_user,
return
(
0
);
}
down
(
&
port
->
sem
);
count
+=
data_offset
;
count
=
(
count
>
port
->
bulk_out_size
)
?
port
->
bulk_out_size
:
count
;
...
...
@@ -456,7 +447,6 @@ static int ftdi_sio_write (struct usb_serial_port *port, int from_user,
if
(
from_user
)
{
if
(
copy_from_user
(
port
->
write_urb
->
transfer_buffer
+
data_offset
,
buf
,
count
-
data_offset
)){
up
(
&
port
->
sem
);
return
-
EFAULT
;
}
}
else
{
...
...
@@ -482,14 +472,11 @@ static int ftdi_sio_write (struct usb_serial_port *port, int from_user,
result
=
usb_submit_urb
(
port
->
write_urb
,
GFP_KERNEL
);
if
(
result
)
{
err
(
__FUNCTION__
" - failed submitting write urb, error %d"
,
result
);
up
(
&
port
->
sem
);
return
0
;
}
up
(
&
port
->
sem
);
dbg
(
__FUNCTION__
" write returning: %d"
,
count
-
data_offset
);
return
(
count
-
data_offset
);
}
/* ftdi_sio_write */
static
void
ftdi_sio_write_bulk_callback
(
struct
urb
*
urb
)
...
...
drivers/usb/serial/ir-usb.c
View file @
8e791974
...
...
@@ -252,8 +252,6 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
dbg
(
"%s - port %d"
,
__FUNCTION__
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -293,9 +291,6 @@ static int ir_open (struct usb_serial_port *port, struct file *filp)
if
(
result
)
err
(
"%s - failed submitting read urb, error %d"
,
__FUNCTION__
,
result
);
}
up
(
&
port
->
sem
);
return
result
;
}
...
...
@@ -312,8 +307,6 @@ static void ir_close (struct usb_serial_port *port, struct file * filp)
if
(
!
serial
)
return
;
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -324,7 +317,6 @@ static void ir_close (struct usb_serial_port *port, struct file * filp)
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
static
int
ir_write
(
struct
usb_serial_port
*
port
,
int
from_user
,
const
unsigned
char
*
buf
,
int
count
)
...
...
drivers/usb/serial/keyspan.c
View file @
8e791974
...
...
@@ -861,10 +861,8 @@ static int keyspan_open (struct usb_serial_port *port, struct file *filp)
dbg
(
"keyspan_open called for port%d.
\n
"
,
port
->
number
);
down
(
&
port
->
sem
);
already_active
=
port
->
open_count
;
++
port
->
open_count
;
up
(
&
port
->
sem
);
if
(
already_active
)
return
0
;
...
...
@@ -926,8 +924,6 @@ static void keyspan_close(struct usb_serial_port *port, struct file *filp)
p_priv
->
out_flip
=
0
;
p_priv
->
in_flip
=
0
;
down
(
&
port
->
sem
);
if
(
--
port
->
open_count
<=
0
)
{
if
(
serial
->
dev
)
{
/* Stop reading/writing urbs */
...
...
@@ -941,7 +937,6 @@ static void keyspan_close(struct usb_serial_port *port, struct file *filp)
port
->
open_count
=
0
;
port
->
tty
=
0
;
}
up
(
&
port
->
sem
);
}
...
...
drivers/usb/serial/keyspan_pda.c
View file @
8e791974
...
...
@@ -662,8 +662,6 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
int
rc
=
0
;
struct
keyspan_pda_private
*
priv
;
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -707,12 +705,9 @@ static int keyspan_pda_open (struct usb_serial_port *port, struct file *filp)
}
up
(
&
port
->
sem
);
return
rc
;
error:
--
port
->
open_count
;
up
(
&
port
->
sem
);
return
rc
;
}
...
...
@@ -721,8 +716,6 @@ static void keyspan_pda_close(struct usb_serial_port *port, struct file *filp)
{
struct
usb_serial
*
serial
=
port
->
serial
;
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -737,8 +730,6 @@ static void keyspan_pda_close(struct usb_serial_port *port, struct file *filp)
}
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
...
...
drivers/usb/serial/kl5kusb105.c
View file @
8e791974
...
...
@@ -358,8 +358,6 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -437,8 +435,6 @@ static int klsi_105_open (struct usb_serial_port *port, struct file *filp)
}
exit:
up
(
&
port
->
sem
);
return
retval
;
}
/* klsi_105_open */
...
...
@@ -455,8 +451,6 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
if
(
!
serial
)
return
;
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -482,8 +476,6 @@ static void klsi_105_close (struct usb_serial_port *port, struct file *filp)
port
->
open_count
=
0
;
info
(
"kl5kusb105 port stats: %ld bytes in, %ld bytes out"
,
priv
->
bytes_in
,
priv
->
bytes_out
);
}
up
(
&
port
->
sem
);
}
/* klsi_105_close */
...
...
@@ -505,9 +497,6 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
/* to lock against someone else trying to
take an URB we just selected from the pool */
while
(
count
>
0
)
{
/* try to find a free urb (write 0 bytes if none) */
struct
urb
*
urb
=
NULL
;
...
...
@@ -543,7 +532,6 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
if
(
from_user
)
{
if
(
copy_from_user
(
urb
->
transfer_buffer
+
KLSI_105_DATA_OFFSET
,
buf
,
size
))
{
up
(
&
port
->
sem
);
return
-
EFAULT
;
}
}
else
{
...
...
@@ -578,7 +566,6 @@ static int klsi_105_write (struct usb_serial_port *port, int from_user,
count
-=
size
;
}
exit:
up
(
&
port
->
sem
);
priv
->
bytes_out
+=
bytes_sent
;
return
bytes_sent
;
/* that's how much we wrote */
...
...
@@ -1021,34 +1008,21 @@ static int klsi_105_ioctl (struct usb_serial_port *port, struct file * file,
static
void
klsi_105_throttle
(
struct
usb_serial_port
*
port
)
{
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
usb_unlink_urb
(
port
->
read_urb
);
up
(
&
port
->
sem
);
return
;
}
static
void
klsi_105_unthrottle
(
struct
usb_serial_port
*
port
)
{
int
result
;
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
port
->
read_urb
->
dev
=
port
->
serial
->
dev
;
result
=
usb_submit_urb
(
port
->
read_urb
,
GFP_KERNEL
);
if
(
result
)
err
(
__FUNCTION__
" - failed submitting read urb, error %d"
,
result
);
up
(
&
port
->
sem
);
return
;
}
...
...
drivers/usb/serial/mct_u232.c
View file @
8e791974
...
...
@@ -341,8 +341,6 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -398,8 +396,6 @@ static int mct_u232_open (struct usb_serial_port *port, struct file *filp)
}
exit:
up
(
&
port
->
sem
);
return
0
;
}
/* mct_u232_open */
...
...
@@ -408,8 +404,6 @@ static void mct_u232_close (struct usb_serial_port *port, struct file *filp)
{
dbg
(
__FUNCTION__
" port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -421,8 +415,6 @@ static void mct_u232_close (struct usb_serial_port *port, struct file *filp)
}
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
/* mct_u232_close */
...
...
@@ -454,16 +446,12 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
bytes_sent
=
0
;
while
(
count
>
0
)
{
down
(
&
port
->
sem
);
size
=
(
count
>
port
->
bulk_out_size
)
?
port
->
bulk_out_size
:
count
;
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
size
,
buf
);
if
(
from_user
)
{
if
(
copy_from_user
(
port
->
write_urb
->
transfer_buffer
,
buf
,
size
))
{
up
(
&
port
->
sem
);
return
-
EFAULT
;
}
}
...
...
@@ -486,12 +474,9 @@ static int mct_u232_write (struct usb_serial_port *port, int from_user,
if
(
result
)
{
err
(
__FUNCTION__
" - failed submitting write urb, error %d"
,
result
);
up
(
&
port
->
sem
);
return
result
;
}
up
(
&
port
->
sem
);
bytes_sent
+=
size
;
if
(
write_blocking
)
interruptible_sleep_on
(
&
port
->
write_wait
);
...
...
drivers/usb/serial/omninet.c
View file @
8e791974
...
...
@@ -157,8 +157,6 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
if
(
!
serial
)
return
-
ENODEV
;
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -166,7 +164,6 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
if
(
!
od
)
{
err
(
__FUNCTION__
"- kmalloc(%Zd) failed."
,
sizeof
(
struct
omninet_data
));
port
->
open_count
=
0
;
up
(
&
port
->
sem
);
return
-
ENOMEM
;
}
...
...
@@ -184,8 +181,6 @@ static int omninet_open (struct usb_serial_port *port, struct file *filp)
err
(
__FUNCTION__
" - failed submitting read urb, error %d"
,
result
);
}
up
(
&
port
->
sem
);
return
result
;
}
...
...
@@ -204,8 +199,6 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
if
(
!
serial
)
return
;
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -220,8 +213,6 @@ static void omninet_close (struct usb_serial_port *port, struct file * filp)
if
(
od
)
kfree
(
od
);
}
up
(
&
port
->
sem
);
}
...
...
drivers/usb/serial/pl2303.c
View file @
8e791974
...
...
@@ -367,8 +367,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -407,7 +405,6 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
result
=
usb_submit_urb
(
port
->
read_urb
,
GFP_KERNEL
);
if
(
result
)
{
err
(
__FUNCTION__
" - failed submitting read urb, error %d"
,
result
);
up
(
&
port
->
sem
);
pl2303_close
(
port
,
NULL
);
return
-
EPROTO
;
}
...
...
@@ -417,12 +414,10 @@ static int pl2303_open (struct usb_serial_port *port, struct file *filp)
result
=
usb_submit_urb
(
port
->
interrupt_in_urb
,
GFP_KERNEL
);
if
(
result
)
{
err
(
__FUNCTION__
" - failed submitting interrupt urb, error %d"
,
result
);
up
(
&
port
->
sem
);
pl2303_close
(
port
,
NULL
);
return
-
EPROTO
;
}
}
up
(
&
port
->
sem
);
return
0
;
}
...
...
@@ -442,8 +437,6 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
if
(
serial
->
dev
)
{
...
...
@@ -478,8 +471,6 @@ static void pl2303_close (struct usb_serial_port *port, struct file *filp)
}
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
static
int
set_modem_info
(
struct
usb_serial_port
*
port
,
unsigned
int
cmd
,
unsigned
int
*
value
)
...
...
drivers/usb/serial/whiteheat.c
View file @
8e791974
...
...
@@ -306,8 +306,6 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
++
port
->
open_count
;
if
(
port
->
open_count
==
1
)
{
...
...
@@ -354,16 +352,12 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
}
dbg
(
__FUNCTION__
" - exit"
);
up
(
&
port
->
sem
);
return
retval
;
error_exit:
--
port
->
open_count
;
dbg
(
__FUNCTION__
" - error_exit"
);
up
(
&
port
->
sem
);
return
retval
;
}
...
...
@@ -374,7 +368,6 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
dbg
(
__FUNCTION__
" - port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
--
port
->
open_count
;
if
(
port
->
open_count
<=
0
)
{
...
...
@@ -391,7 +384,6 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
usb_unlink_urb
(
port
->
read_urb
);
port
->
open_count
=
0
;
}
up
(
&
port
->
sem
);
}
...
...
@@ -410,8 +402,6 @@ static void whiteheat_set_termios (struct usb_serial_port *port, struct termios
dbg
(
__FUNCTION__
" -port %d"
,
port
->
number
);
down
(
&
port
->
sem
);
if
((
!
port
->
tty
)
||
(
!
port
->
tty
->
termios
))
{
dbg
(
__FUNCTION__
" - no tty structures"
);
goto
exit
;
...
...
@@ -492,7 +482,6 @@ static void whiteheat_set_termios (struct usb_serial_port *port, struct termios
whiteheat_send_cmd
(
port
->
serial
,
WHITEHEAT_SETUP_PORT
,
(
__u8
*
)
&
port_settings
,
sizeof
(
port_settings
));
exit:
up
(
&
port
->
sem
);
return
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment