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
b8a7b080
Commit
b8a7b080
authored
Apr 17, 2003
by
Christoph Hellwig
Committed by
Jeff Garzik
Apr 17, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] devfs: minor miscdev changes
Make sure the first argument to devfs_register is zero.
parent
2e080de9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
drivers/char/misc.c
drivers/char/misc.c
+11
-9
No files found.
drivers/char/misc.c
View file @
b8a7b080
...
@@ -166,8 +166,8 @@ static struct file_operations misc_fops = {
...
@@ -166,8 +166,8 @@ static struct file_operations misc_fops = {
int
misc_register
(
struct
miscdevice
*
misc
)
int
misc_register
(
struct
miscdevice
*
misc
)
{
{
static
devfs_handle_t
devfs_handle
,
dir
;
struct
miscdevice
*
c
;
struct
miscdevice
*
c
;
char
buf
[
256
];
if
(
misc
->
next
||
misc
->
prev
)
if
(
misc
->
next
||
misc
->
prev
)
return
-
EBUSY
;
return
-
EBUSY
;
...
@@ -195,14 +195,16 @@ int misc_register(struct miscdevice * misc)
...
@@ -195,14 +195,16 @@ int misc_register(struct miscdevice * misc)
}
}
if
(
misc
->
minor
<
DYNAMIC_MINORS
)
if
(
misc
->
minor
<
DYNAMIC_MINORS
)
misc_minors
[
misc
->
minor
>>
3
]
|=
1
<<
(
misc
->
minor
&
7
);
misc_minors
[
misc
->
minor
>>
3
]
|=
1
<<
(
misc
->
minor
&
7
);
if
(
!
devfs_handle
)
devfs_handle
=
devfs_mk_dir
(
"misc"
);
dir
=
strchr
(
misc
->
name
,
'/'
)
?
NULL
:
devfs_handle
;
/* yuck, yet another stupid special-casing. We should rather
misc
->
devfs_handle
=
add ->devfs_name to avoid this mess. */
devfs_register
(
dir
,
misc
->
name
,
DEVFS_FL_NONE
,
snprintf
(
buf
,
sizeof
(
buf
),
strchr
(
misc
->
name
,
'/'
)
?
MISC_MAJOR
,
misc
->
minor
,
"%s"
:
"misc/%s"
,
misc
->
name
);
S_IFCHR
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
,
misc
->
devfs_handle
=
devfs_register
(
NULL
,
buf
,
0
,
misc
->
fops
,
NULL
);
MISC_MAJOR
,
misc
->
minor
,
S_IFCHR
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
,
misc
->
fops
,
NULL
);
/*
/*
* Add it to the front, so that later devices can "override"
* Add it to the front, so that later devices can "override"
...
...
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