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
6b98d858
Commit
6b98d858
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/alpha/kernel/srmcons.c converted to dynamic allocation
parent
cb81a46d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
arch/alpha/kernel/srmcons.c
arch/alpha/kernel/srmcons.c
+22
-12
No files found.
arch/alpha/kernel/srmcons.c
View file @
6b98d858
...
...
@@ -264,16 +264,9 @@ srmcons_close(struct tty_struct *tty, struct file *filp)
}
static
struct
tty_driver
srmcons_driver
=
{
.
driver_name
=
"srm"
,
.
name
=
"srm"
,
.
magic
=
TTY_DRIVER_MAGIC
,
.
major
=
0
,
/* dynamic */
.
minor_start
=
0
,
.
num
=
MAX_SRM_CONSOLE_DEVICES
,
.
type
=
TTY_DRIVER_TYPE_SYSTEM
,
.
subtype
=
SYSTEM_TYPE_SYSCONS
,
static
struct
tty_driver
*
srmcons_driver
;
static
struct
tty_operations
srmcons_ops
=
{
.
open
=
srmcons_open
,
.
close
=
srmcons_close
,
.
write
=
srmcons_write
,
...
...
@@ -285,8 +278,25 @@ static int __init
srmcons_init
(
void
)
{
if
(
srm_is_registered_console
)
{
srmcons_driver
.
init_termios
=
tty_std_termios
;
return
tty_register_driver
(
&
srmcons_driver
);
struct
tty_driver
*
driver
;
int
err
;
driver
=
alloc_tty_driver
(
MAX_SRM_CONSOLE_DEVICES
);
if
(
!
driver
)
return
-
ENOMEM
;
driver
->
driver_name
=
"srm"
;
driver
->
name
=
"srm"
;
driver
->
major
=
0
;
/* dynamic */
driver
->
minor_start
=
0
;
driver
->
type
=
TTY_DRIVER_TYPE_SYSTEM
;
driver
->
subtype
=
SYSTEM_TYPE_SYSCONS
;
driver
->
init_termios
=
tty_std_termios
;
err
=
tty_register_driver
(
driver
);
if
(
err
)
{
put_tty_driver
(
driver
);
return
err
;
}
srmcons_driver
=
driver
;
}
return
-
ENODEV
;
...
...
@@ -312,7 +322,7 @@ static struct tty_driver *
srm_console_device
(
struct
console
*
co
,
int
*
index
)
{
*
index
=
co
->
index
;
return
&
srmcons_driver
;
return
srmcons_driver
;
}
static
int
__init
...
...
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