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
78846ce6
Commit
78846ce6
authored
Mar 31, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtl8192u: switch to proc_create()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
859d22f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
31 deletions
+22
-31
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+22
-31
No files found.
drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
View file @
78846ce6
...
@@ -243,39 +243,34 @@ static int debug = \
...
@@ -243,39 +243,34 @@ static int debug = \
;
;
struct
proc_dir_entry
*
ieee80211_proc
;
struct
proc_dir_entry
*
ieee80211_proc
;
static
int
show_debug_level
(
char
*
page
,
char
**
start
,
off_t
offset
,
static
int
show_debug_level
(
struct
seq_file
*
m
,
void
*
v
)
int
count
,
int
*
eof
,
void
*
data
)
{
{
return
s
nprintf
(
page
,
count
,
"0x%08X
\n
"
,
ieee80211_debug_level
);
return
s
eq_printf
(
m
,
"0x%08X
\n
"
,
ieee80211_debug_level
);
}
}
static
int
store_debug_level
(
struct
file
*
file
,
const
cha
r
*
buffer
,
static
ssize_t
write_debug_level
(
struct
file
*
file
,
const
char
__use
r
*
buffer
,
unsigned
long
count
,
void
*
data
)
size_t
count
,
loff_t
*
ppos
)
{
{
char
buf
[]
=
"0x00000000"
;
unsigned
long
len
=
min_t
(
unsigned
long
,
sizeof
(
buf
)
-
1
,
count
);
char
*
p
=
(
char
*
)
buf
;
unsigned
long
val
;
unsigned
long
val
;
int
err
=
kstrtoul_from_user
(
buffer
,
count
,
0
,
&
val
);
if
(
copy_from_user
(
buf
,
buffer
,
len
))
if
(
err
)
return
count
;
return
err
;
buf
[
len
]
=
0
;
if
(
p
[
1
]
==
'x'
||
p
[
1
]
==
'X'
||
p
[
0
]
==
'x'
||
p
[
0
]
==
'X'
)
{
p
++
;
if
(
p
[
0
]
==
'x'
||
p
[
0
]
==
'X'
)
p
++
;
val
=
simple_strtoul
(
p
,
&
p
,
16
);
}
else
val
=
simple_strtoul
(
p
,
&
p
,
10
);
if
(
p
==
buf
)
printk
(
KERN_INFO
DRV_NAME
": %s is not in hex or decimal form.
\n
"
,
buf
);
else
ieee80211_debug_level
=
val
;
ieee80211_debug_level
=
val
;
return
count
;
}
return
strnlen
(
buf
,
count
);
static
int
open_debug_level
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
show_debug_level
,
NULL
);
}
}
static
const
struct
file_operations
fops
=
{
.
open
=
open_debug_level
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
write
=
write_debug_level
};
int
__init
ieee80211_debug_init
(
void
)
int
__init
ieee80211_debug_init
(
void
)
{
{
struct
proc_dir_entry
*
e
;
struct
proc_dir_entry
*
e
;
...
@@ -288,17 +283,13 @@ int __init ieee80211_debug_init(void)
...
@@ -288,17 +283,13 @@ int __init ieee80211_debug_init(void)
" proc directory
\n
"
);
" proc directory
\n
"
);
return
-
EIO
;
return
-
EIO
;
}
}
e
=
create_proc_entry
(
"debug_level"
,
S_IFREG
|
S_IRUGO
|
S_IWUSR
,
e
=
proc_create
(
"debug_level"
,
S_IRUGO
|
S_IWUSR
,
ieee80211_proc
);
ieee80211_proc
,
&
fops
);
if
(
!
e
)
{
if
(
!
e
)
{
remove_proc_entry
(
DRV_NAME
,
init_net
.
proc_net
);
remove_proc_entry
(
DRV_NAME
,
init_net
.
proc_net
);
ieee80211_proc
=
NULL
;
ieee80211_proc
=
NULL
;
return
-
EIO
;
return
-
EIO
;
}
}
e
->
read_proc
=
show_debug_level
;
e
->
write_proc
=
store_debug_level
;
e
->
data
=
NULL
;
return
0
;
return
0
;
}
}
...
...
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