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
Kirill Smelkov
linux
Commits
c3527bf0
Commit
c3527bf0
authored
Jun 11, 2003
by
Alexander Viro
Committed by
Linus Torvalds
Jun 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] tty_driver refcounting
drivers/char/vme_scc.c converted to dynamic allocation
parent
af0076e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
35 deletions
+39
-35
drivers/char/vme_scc.c
drivers/char/vme_scc.c
+39
-35
No files found.
drivers/char/vme_scc.c
View file @
c3527bf0
...
...
@@ -90,7 +90,7 @@ static irqreturn_t scc_spcond_int(int irq, void *data, struct pt_regs *fp);
static
void
scc_setsignals
(
struct
scc_port
*
port
,
int
dtr
,
int
rts
);
static
void
scc_break_ctl
(
struct
tty_struct
*
tty
,
int
break_state
);
static
struct
tty_driver
scc_driver
;
static
struct
tty_driver
*
scc_driver
;
struct
scc_port
scc_ports
[
2
];
...
...
@@ -115,6 +115,25 @@ static struct real_driver scc_real_driver = {
};
static
struct
tty_operations
scc_ops
=
{
.
open
=
scc_open
,
.
close
=
gs_close
,
.
write
=
gs_write
,
.
put_char
=
gs_put_char
,
.
flush_chars
=
gs_flush_chars
,
.
write_room
=
gs_write_room
,
.
chars_in_buffer
=
gs_chars_in_buffer
,
.
flush_buffer
=
gs_flush_buffer
,
.
ioctl
=
scc_ioctl
,
.
throttle
=
scc_throttle
,
.
unthrottle
=
scc_unthrottle
,
.
set_termios
=
gs_set_termios
,
.
stop
=
gs_stop
,
.
start
=
gs_start
,
.
hangup
=
gs_hangup
,
.
break_ctl
=
scc_break_ctl
,
};
/*----------------------------------------------------------------------------
* vme_scc_init() and support functions
*---------------------------------------------------------------------------*/
...
...
@@ -123,42 +142,27 @@ static int scc_init_drivers(void)
{
int
error
;
memset
(
&
scc_driver
,
0
,
sizeof
(
scc_driver
)
);
scc_driver
.
magic
=
TTY_DRIVER_MAGIC
;
scc_driver
.
owner
=
THIS_MODULE
;
scc_driver
.
driver_name
=
"scc"
;
scc_driver
.
name
=
"ttyS
"
;
scc_driver
.
devfs_name
=
"tts/
"
;
scc_driver
.
major
=
TTY_MAJOR
;
scc_driver
.
minor_start
=
SCC_MINOR_BASE
;
scc_driver
.
num
=
2
;
scc_driver
.
type
=
TTY_DRIVER_TYPE_SERIAL
;
scc_driver
.
subtype
=
SERIAL_TYPE_NORMAL
;
scc_driver
.
init_termios
=
tty_std_termios
;
scc_driver
.
init_termios
.
c_cflag
=
scc_driver
=
alloc_tty_driver
(
2
);
if
(
!
scc_driver
)
return
-
ENOMEM
;
scc_driver
->
owner
=
THIS_MODULE
;
scc_driver
->
driver_name
=
"scc
"
;
scc_driver
->
name
=
"ttyS
"
;
scc_driver
->
devfs_name
=
"tts/"
;
scc_driver
->
major
=
TTY_MAJOR
;
scc_driver
->
minor_start
=
SCC_MINOR_BASE
;
scc_driver
->
type
=
TTY_DRIVER_TYPE_SERIAL
;
scc_driver
->
subtype
=
SERIAL_TYPE_NORMAL
;
scc_driver
->
init_termios
=
tty_std_termios
;
scc_driver
->
init_termios
.
c_cflag
=
B9600
|
CS8
|
CREAD
|
HUPCL
|
CLOCAL
;
scc_driver
.
flags
=
TTY_DRIVER_REAL_RAW
;
scc_driver
.
open
=
scc_open
;
scc_driver
.
close
=
gs_close
;
scc_driver
.
write
=
gs_write
;
scc_driver
.
put_char
=
gs_put_char
;
scc_driver
.
flush_chars
=
gs_flush_chars
;
scc_driver
.
write_room
=
gs_write_room
;
scc_driver
.
chars_in_buffer
=
gs_chars_in_buffer
;
scc_driver
.
flush_buffer
=
gs_flush_buffer
;
scc_driver
.
ioctl
=
scc_ioctl
;
scc_driver
.
throttle
=
scc_throttle
;
scc_driver
.
unthrottle
=
scc_unthrottle
;
scc_driver
.
set_termios
=
gs_set_termios
;
scc_driver
.
stop
=
gs_stop
;
scc_driver
.
start
=
gs_start
;
scc_driver
.
hangup
=
gs_hangup
;
scc_driver
.
break_ctl
=
scc_break_ctl
;
if
((
error
=
tty_register_driver
(
&
scc_driver
)))
{
scc_driver
->
flags
=
TTY_DRIVER_REAL_RAW
;
tty_set_operations
(
scc_driver
,
&
scc_ops
);
if
((
error
=
tty_register_driver
(
scc_driver
)))
{
printk
(
KERN_ERR
"scc: Couldn't register scc driver, error = %d
\n
"
,
error
);
put_tty_driver
(
scc_driver
);
return
1
;
}
...
...
@@ -1026,7 +1030,7 @@ static void scc_console_write (struct console *co, const char *str, unsigned cou
static
struct
tty_driver
*
scc_console_device
(
struct
console
*
c
,
int
*
index
)
{
*
index
=
c
->
index
;
return
&
scc_driver
;
return
scc_driver
;
}
...
...
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