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
b91a902e
Commit
b91a902e
authored
Jan 10, 2004
by
Alexander Viro
Committed by
Stephen Hemminger
Jan 10, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[netdrvr stnic] use alloc_etherdev
parent
074821d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
drivers/net/stnic.c
drivers/net/stnic.c
+24
-16
No files found.
drivers/net/stnic.c
View file @
b91a902e
...
...
@@ -98,26 +98,27 @@ STNIC_WRITE (int reg, byte val)
STNIC_DELAY
();
}
int
__init
stnic_probe
(
void
)
static
int
__init
stnic_probe
(
void
)
{
struct
net_device
*
dev
;
int
i
;
int
i
,
err
;
/* If we are not running on a SolutionEngine, give up now */
if
(
!
MACH_SE
)
return
-
ENODEV
;
/* New style probing API */
dev
=
init_etherdev
(
NULL
,
0
);
dev
=
alloc_etherdev
(
0
);
if
(
!
dev
)
return
-
ENOMEM
;
SET_MODULE_OWNER
(
dev
);
stnic_dev
=
dev
;
dev
->
probe
=
NULL
;
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if
(
ethdev_init
(
dev
))
{
printk
(
KERN_EMERG
"Unable to get memory for dev->priv.
\n
"
);
free_netdev
(
dev
);
return
-
ENOMEM
;
}
...
...
@@ -135,13 +136,12 @@ int __init stnic_probe(void)
/* Snarf the interrupt now. There's no point in waiting since we cannot
share and the board will usually be enabled. */
i
=
request_irq
(
dev
->
irq
,
ei_interrupt
,
0
,
dev
->
name
,
dev
);
if
(
i
)
{
err
=
request_irq
(
dev
->
irq
,
ei_interrupt
,
0
,
dev
->
name
,
dev
);
if
(
err
)
{
printk
(
KERN_EMERG
" unable to get IRQ %d.
\n
"
,
dev
->
irq
);
unregister_netdev
(
dev
);
kfree
(
dev
->
priv
);
kfree
(
dev
);
return
i
;
free_netdev
(
dev
);
return
err
;
}
ei_status
.
name
=
dev
->
name
;
...
...
@@ -162,6 +162,15 @@ int __init stnic_probe(void)
stnic_init
(
dev
);
err
=
register_netdev
(
dev
);
if
(
err
)
{
free_irq
(
dev
->
irq
,
dev
);
kfree
(
dev
->
priv
);
free_netdev
(
dev
);
return
err
;
}
stnic_dev
=
dev
;
printk
(
KERN_INFO
"NS ST-NIC 83902A
\n
"
);
return
0
;
...
...
@@ -305,15 +314,14 @@ stnic_init (struct net_device *dev)
return
;
}
/* Hardware interrupt handler. */
extern
void
ei_interrupt
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
void
do_stnic_intr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
)
static
void
__exit
stnic_cleanup
(
void
)
{
ei_interrupt
(
0
,
stnic_dev
,
regs
);
unregister_netdev
(
stnic_dev
);
free_irq
(
stnic_dev
->
irq
,
stnic_dev
);
kfree
(
stnic_dev
->
priv
);
free_netdev
(
stnic_dev
);
}
module_init
(
stnic_probe
);
/* No cleanup routine. */
module_exit
(
stnic_cleanup
);
MODULE_LICENSE
(
"GPL"
);
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