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
bd811ee2
Commit
bd811ee2
authored
Aug 04, 2003
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[NET]: Convert lp486e over to dynamic allocation.
parent
14596f96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
18 deletions
+14
-18
drivers/net/lp486e.c
drivers/net/lp486e.c
+14
-18
No files found.
drivers/net/lp486e.c
View file @
bd811ee2
...
@@ -975,15 +975,7 @@ int __init lp486e_probe(struct net_device *dev) {
...
@@ -975,15 +975,7 @@ int __init lp486e_probe(struct net_device *dev) {
return
-
EBUSY
;
return
-
EBUSY
;
}
}
/*
* Allocate working memory, 16-byte aligned
*/
dev
->
mem_start
=
(
unsigned
long
)
kmalloc
(
sizeof
(
struct
i596_private
)
+
0x0f
,
GFP_KERNEL
);
if
(
!
dev
->
mem_start
)
goto
err_out
;
dev
->
priv
=
(
void
*
)((
dev
->
mem_start
+
0xf
)
&
0xfffffff0
);
lp
=
(
struct
i596_private
*
)
dev
->
priv
;
lp
=
(
struct
i596_private
*
)
dev
->
priv
;
memset
((
void
*
)
lp
,
0
,
sizeof
(
struct
i596_private
));
spin_lock_init
(
&
lp
->
cmd_lock
);
spin_lock_init
(
&
lp
->
cmd_lock
);
/*
/*
...
@@ -997,7 +989,6 @@ int __init lp486e_probe(struct net_device *dev) {
...
@@ -997,7 +989,6 @@ int __init lp486e_probe(struct net_device *dev) {
dev
->
base_addr
=
IOADDR
;
dev
->
base_addr
=
IOADDR
;
dev
->
irq
=
IRQ
;
dev
->
irq
=
IRQ
;
ether_setup
(
dev
);
/*
/*
* How do we find the ethernet address? I don't know.
* How do we find the ethernet address? I don't know.
...
@@ -1045,8 +1036,6 @@ int __init lp486e_probe(struct net_device *dev) {
...
@@ -1045,8 +1036,6 @@ int __init lp486e_probe(struct net_device *dev) {
return
0
;
return
0
;
err_out_kfree:
err_out_kfree:
kfree
((
void
*
)
dev
->
mem_start
);
err_out:
release_region
(
IOADDR
,
LP486E_TOTAL_SIZE
);
release_region
(
IOADDR
,
LP486E_TOTAL_SIZE
);
return
ret
;
return
ret
;
}
}
...
@@ -1318,29 +1307,36 @@ MODULE_PARM(debug, "i");
...
@@ -1318,29 +1307,36 @@ MODULE_PARM(debug, "i");
MODULE_PARM
(
options
,
"1-"
__MODULE_STRING
(
MAX_UNITS
)
"i"
);
MODULE_PARM
(
options
,
"1-"
__MODULE_STRING
(
MAX_UNITS
)
"i"
);
MODULE_PARM
(
full_duplex
,
"1-"
__MODULE_STRING
(
MAX_UNITS
)
"i"
);
MODULE_PARM
(
full_duplex
,
"1-"
__MODULE_STRING
(
MAX_UNITS
)
"i"
);
static
struct
net_device
dev_lp486e
;
static
struct
net_device
*
dev_lp486e
;
static
int
full_duplex
;
static
int
full_duplex
;
static
int
options
;
static
int
options
;
static
int
io
=
IOADDR
;
static
int
io
=
IOADDR
;
static
int
irq
=
IRQ
;
static
int
irq
=
IRQ
;
static
int
__init
lp486e_init_module
(
void
)
{
static
int
__init
lp486e_init_module
(
void
)
{
struct
net_device
*
dev
=
&
dev_lp486e
;
struct
net_device
*
dev
;
dev
=
alloc_etherdev
(
sizeof
(
struct
i596_private
));
if
(
!
dev
)
return
-
ENOMEM
;
dev
->
irq
=
irq
;
dev
->
irq
=
irq
;
dev
->
base_addr
=
io
;
dev
->
base_addr
=
io
;
dev
->
init
=
lp486e_probe
;
dev
->
init
=
lp486e_probe
;
if
(
register_netdev
(
dev
)
!=
0
)
if
(
register_netdev
(
dev
)
!=
0
)
{
kfree
(
dev
);
return
-
EIO
;
return
-
EIO
;
}
dev_lp486e
=
dev
;
full_duplex
=
0
;
full_duplex
=
0
;
options
=
0
;
options
=
0
;
return
0
;
return
0
;
}
}
static
void
__exit
lp486e_cleanup_module
(
void
)
{
static
void
__exit
lp486e_cleanup_module
(
void
)
{
unregister_netdev
(
&
dev_lp486e
);
unregister_netdev
(
dev_lp486e
);
kfree
((
void
*
)
dev_lp486e
.
mem_start
);
release_region
(
dev_lp486e
->
base_addr
,
LP486E_TOTAL_SIZE
);
dev_lp486e
.
priv
=
NULL
;
kfree
(
dev_lp486e
);
release_region
(
dev_lp486e
.
base_addr
,
LP486E_TOTAL_SIZE
);
}
}
module_init
(
lp486e_init_module
);
module_init
(
lp486e_init_module
);
...
...
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