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
51442d5a
Commit
51442d5a
authored
May 07, 2003
by
Hanna V. Linder
Committed by
Greg Kroah-Hartman
May 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] moxa tty_driver add .owner field remove MOD_INC/DEC_USE_COUNT
parent
fb762119
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
drivers/char/moxa.c
drivers/char/moxa.c
+2
-10
No files found.
drivers/char/moxa.c
View file @
51442d5a
...
...
@@ -341,6 +341,7 @@ int moxa_init(void)
memset
(
&
moxaDriver
,
0
,
sizeof
(
struct
tty_driver
));
memset
(
&
moxaCallout
,
0
,
sizeof
(
struct
tty_driver
));
moxaDriver
.
magic
=
TTY_DRIVER_MAGIC
;
moxaDriver
.
owner
=
THIS_MODULE
;
moxaDriver
.
name
=
"ttya"
;
moxaDriver
.
major
=
ttymajor
;
moxaDriver
.
minor_start
=
0
;
...
...
@@ -544,7 +545,6 @@ static void do_moxa_softint(void *private_)
ch
->
asyncflags
&=
~
(
ASYNC_NORMAL_ACTIVE
|
ASYNC_CALLOUT_ACTIVE
);
}
}
MOD_DEC_USE_COUNT
;
}
static
int
moxa_open
(
struct
tty_struct
*
tty
,
struct
file
*
filp
)
...
...
@@ -556,7 +556,6 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
port
=
PORTNO
(
tty
);
if
(
port
==
MAX_PORTS
)
{
MOD_INC_USE_COUNT
;
return
(
0
);
}
if
(
!
MoxaPortIsValid
(
port
))
{
...
...
@@ -579,7 +578,6 @@ static int moxa_open(struct tty_struct *tty, struct file *filp)
}
up
(
&
moxaBuffSem
);
MOD_INC_USE_COUNT
;
ch
=
&
moxaChannels
[
port
];
ch
->
count
++
;
tty
->
driver_data
=
ch
;
...
...
@@ -619,7 +617,6 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
port
=
PORTNO
(
tty
);
if
(
port
==
MAX_PORTS
)
{
MOD_DEC_USE_COUNT
;
return
;
}
if
(
!
MoxaPortIsValid
(
port
))
{
...
...
@@ -633,7 +630,6 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
return
;
}
if
(
tty_hung_up_p
(
filp
))
{
MOD_DEC_USE_COUNT
;
return
;
}
ch
=
(
struct
moxa_str
*
)
tty
->
driver_data
;
...
...
@@ -649,7 +645,6 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
ch
->
count
=
0
;
}
if
(
ch
->
count
)
{
MOD_DEC_USE_COUNT
;
return
;
}
ch
->
asyncflags
|=
ASYNC_CLOSING
;
...
...
@@ -688,7 +683,6 @@ static void moxa_close(struct tty_struct *tty, struct file *filp)
ch
->
asyncflags
&=
~
(
ASYNC_NORMAL_ACTIVE
|
ASYNC_CALLOUT_ACTIVE
|
ASYNC_CLOSING
);
wake_up_interruptible
(
&
ch
->
close_wait
);
MOD_DEC_USE_COUNT
;
}
static
int
moxa_write
(
struct
tty_struct
*
tty
,
int
from_user
,
...
...
@@ -1024,9 +1018,7 @@ static void moxa_poll(unsigned long ignored)
wake_up_interruptible
(
&
ch
->
open_wait
);
else
{
set_bit
(
MOXA_EVENT_HANGUP
,
&
ch
->
event
);
MOD_DEC_USE_COUNT
;
if
(
schedule_work
(
&
ch
->
tqueue
)
==
0
)
MOD_INC_USE_COUNT
;
schedule_work
(
&
ch
->
tqueue
);
}
}
}
...
...
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