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
c9c2c666
Commit
c9c2c666
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
arch/ppc/4xx_io/serial_sicc.c converted to dynamic allocation
parent
33ee8ba6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
35 deletions
+38
-35
arch/ppc/4xx_io/serial_sicc.c
arch/ppc/4xx_io/serial_sicc.c
+38
-35
No files found.
arch/ppc/4xx_io/serial_sicc.c
View file @
c9c2c666
...
...
@@ -197,7 +197,7 @@
/*
* Things needed by tty driver
*/
static
struct
tty_driver
siccnormal_driver
;
static
struct
tty_driver
*
siccnormal_driver
;
#if defined(CONFIG_SERIAL_SICC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
...
...
@@ -1760,43 +1760,46 @@ static int siccuart_open(struct tty_struct *tty, struct file *filp)
return
0
;
}
static
struct
tty_operations
sicc_ops
=
{
.
open
=
siccuart_open
,
.
close
=
siccuart_close
,
.
write
=
siccuart_write
,
.
put_char
=
siccuart_put_char
,
.
flush_chars
=
siccuart_flush_chars
,
.
write_room
=
siccuart_write_room
,
.
chars_in_buffer
=
siccuart_chars_in_buffer
,
.
flush_buffer
=
siccuart_flush_buffer
,
.
ioctl
=
siccuart_ioctl
,
.
throttle
=
siccuart_throttle
,
.
unthrottle
=
siccuart_unthrottle
,
.
send_xchar
=
siccuart_send_xchar
,
.
set_termios
=
siccuart_set_termios
,
.
stop
=
siccuart_stop
,
.
start
=
siccuart_start
,
.
hangup
=
siccuart_hangup
,
.
break_ctl
=
siccuart_break_ctl
,
.
wait_until_sent
=
siccuart_wait_until_sent
,
};
int
__init
siccuart_init
(
void
)
{
int
i
;
siccnormal_driver
=
alloc_tty_driver
(
SERIAL_SICC_NR
);
if
(
!
siccnormal_driver
)
return
-
ENOMEM
;
printk
(
"IBM Vesta SICC serial port driver V 0.1 by Yudong Yang and Yi Ge / IBM CRL .
\n
"
);
siccnormal_driver
.
magic
=
TTY_DRIVER_MAGIC
;
siccnormal_driver
.
driver_name
=
"serial_sicc"
;
siccnormal_driver
.
name
=
SERIAL_SICC_NAME
;
siccnormal_driver
.
major
=
SERIAL_SICC_MAJOR
;
siccnormal_driver
.
minor_start
=
SERIAL_SICC_MINOR
;
siccnormal_driver
.
num
=
SERIAL_SICC_NR
;
siccnormal_driver
.
type
=
TTY_DRIVER_TYPE_SERIAL
;
siccnormal_driver
.
subtype
=
SERIAL_TYPE_NORMAL
;
siccnormal_driver
.
init_termios
=
tty_std_termios
;
siccnormal_driver
.
init_termios
.
c_cflag
=
B9600
|
CS8
|
CREAD
|
HUPCL
|
CLOCAL
;
siccnormal_driver
.
flags
=
TTY_DRIVER_REAL_RAW
|
TTY_DRIVER_NO_DEVFS
;
siccnormal_driver
.
open
=
siccuart_open
;
siccnormal_driver
.
close
=
siccuart_close
;
siccnormal_driver
.
write
=
siccuart_write
;
siccnormal_driver
.
put_char
=
siccuart_put_char
;
siccnormal_driver
.
flush_chars
=
siccuart_flush_chars
;
siccnormal_driver
.
write_room
=
siccuart_write_room
;
siccnormal_driver
.
chars_in_buffer
=
siccuart_chars_in_buffer
;
siccnormal_driver
.
flush_buffer
=
siccuart_flush_buffer
;
siccnormal_driver
.
ioctl
=
siccuart_ioctl
;
siccnormal_driver
.
throttle
=
siccuart_throttle
;
siccnormal_driver
.
unthrottle
=
siccuart_unthrottle
;
siccnormal_driver
.
send_xchar
=
siccuart_send_xchar
;
siccnormal_driver
.
set_termios
=
siccuart_set_termios
;
siccnormal_driver
.
stop
=
siccuart_stop
;
siccnormal_driver
.
start
=
siccuart_start
;
siccnormal_driver
.
hangup
=
siccuart_hangup
;
siccnormal_driver
.
break_ctl
=
siccuart_break_ctl
;
siccnormal_driver
.
wait_until_sent
=
siccuart_wait_until_sent
;
siccnormal_driver
.
read_proc
=
NULL
;
if
(
tty_register_driver
(
&
siccnormal_driver
))
siccnormal_driver
->
driver_name
=
"serial_sicc"
;
siccnormal_driver
->
name
=
SERIAL_SICC_NAME
;
siccnormal_driver
->
major
=
SERIAL_SICC_MAJOR
;
siccnormal_driver
->
minor_start
=
SERIAL_SICC_MINOR
;
siccnormal_driver
->
type
=
TTY_DRIVER_TYPE_SERIAL
;
siccnormal_driver
->
subtype
=
SERIAL_TYPE_NORMAL
;
siccnormal_driver
->
init_termios
=
tty_std_termios
;
siccnormal_driver
->
init_termios
.
c_cflag
=
B9600
|
CS8
|
CREAD
|
HUPCL
|
CLOCAL
;
siccnormal_driver
->
flags
=
TTY_DRIVER_REAL_RAW
|
TTY_DRIVER_NO_DEVFS
;
tty_set_operations
(
siccnormal_driver
,
&
sicc_ops
);
if
(
tty_register_driver
(
siccnormal_driver
))
panic
(
"Couldn't register SICC serial driver
\n
"
);
for
(
i
=
0
;
i
<
SERIAL_SICC_NR
;
i
++
)
{
...
...
@@ -1902,7 +1905,7 @@ static int siccuart_console_wait_key(struct console *co)
static
struct
tty_driver
*
siccuart_console_device
(
struct
console
*
c
,
int
*
index
)
{
*
index
=
c
->
index
;
return
&
siccnormal_driver
;
return
siccnormal_driver
;
}
static
int
__init
siccuart_console_setup
(
struct
console
*
co
,
char
*
options
)
...
...
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