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
f637e75d
Commit
f637e75d
authored
Nov 27, 2002
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr tc35815] let init_etherdev allocate driver-private struct too
Contributed by davej, fixed up by me.
parent
505c602f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
drivers/net/tc35815.c
drivers/net/tc35815.c
+6
-12
No files found.
drivers/net/tc35815.c
View file @
f637e75d
...
@@ -536,10 +536,15 @@ static int __init tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr, u
...
@@ -536,10 +536,15 @@ static int __init tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr, u
struct
net_device
*
dev
;
struct
net_device
*
dev
;
/* Allocate a new 'dev' if needed. */
/* Allocate a new 'dev' if needed. */
dev
=
init_etherdev
(
NULL
,
0
);
dev
=
init_etherdev
(
NULL
,
sizeof
(
struct
tc35815_local
)
);
if
(
dev
==
NULL
)
if
(
dev
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
/*
* init_etherdev allocs and zeros dev->priv
*/
lp
=
dev
->
priv
;
if
(
tc35815_debug
&&
version_printed
++
==
0
)
if
(
tc35815_debug
&&
version_printed
++
==
0
)
printk
(
KERN_DEBUG
"%s"
,
version
);
printk
(
KERN_DEBUG
"%s"
,
version
);
...
@@ -571,17 +576,7 @@ static int __init tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr, u
...
@@ -571,17 +576,7 @@ static int __init tc35815_probe1(struct pci_dev *pdev, unsigned int base_addr, u
printk
(
"
\n
"
);
printk
(
"
\n
"
);
/* Initialize the device structure. */
/* Initialize the device structure. */
if
(
dev
->
priv
==
NULL
)
{
dev
->
priv
=
kmalloc
(
sizeof
(
struct
tc35815_local
),
GFP_KERNEL
);
if
(
dev
->
priv
==
NULL
)
return
-
ENODEV
;
}
lp
=
dev
->
priv
;
lp
->
pdev
=
pdev
;
lp
->
pdev
=
pdev
;
memset
(
lp
,
0
,
sizeof
(
struct
tc35815_local
));
lp
->
next_module
=
root_tc35815_dev
;
lp
->
next_module
=
root_tc35815_dev
;
root_tc35815_dev
=
dev
;
root_tc35815_dev
=
dev
;
...
@@ -1764,7 +1759,6 @@ static void __exit tc35815_cleanup_module(void)
...
@@ -1764,7 +1759,6 @@ static void __exit tc35815_cleanup_module(void)
while
(
root_tc35815_dev
)
{
while
(
root_tc35815_dev
)
{
struct
net_device
*
dev
=
root_tc35815_dev
;
struct
net_device
*
dev
=
root_tc35815_dev
;
next_dev
=
((
struct
tc35815_local
*
)
dev
->
priv
)
->
next_module
;
next_dev
=
((
struct
tc35815_local
*
)
dev
->
priv
)
->
next_module
;
kfree
(
dev
->
priv
);
iounmap
((
void
*
)(
dev
->
base_addr
));
iounmap
((
void
*
)(
dev
->
base_addr
));
unregister_netdev
(
dev
);
unregister_netdev
(
dev
);
kfree
(
dev
);
kfree
(
dev
);
...
...
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