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
4f75fe2d
Commit
4f75fe2d
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 zorro8390] alloc_etherdev, SET_MODULE_OWNER
parent
f2bdfb61
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
drivers/net/zorro8390.c
drivers/net/zorro8390.c
+14
-5
No files found.
drivers/net/zorro8390.c
View file @
4f75fe2d
...
...
@@ -103,18 +103,19 @@ static int __init zorro8390_probe(void)
continue
;
board
=
z
->
resource
.
start
;
ioaddr
=
board
+
cards
[
i
].
offset
;
dev
=
init_etherdev
(
0
,
0
);
SET_MODULE_OWNER
(
dev
);
dev
=
alloc_etherdev
(
0
);
if
(
!
dev
)
return
-
ENOMEM
;
dev
->
priv
=
NULL
;
SET_MODULE_OWNER
(
dev
);
if
(
!
request_mem_region
(
ioaddr
,
NE_IO_EXTENT
*
2
,
dev
->
name
))
{
kfree
(
dev
);
free_netdev
(
dev
);
continue
;
}
if
((
err
=
zorro8390_init
(
dev
,
board
,
cards
[
i
].
name
,
ZTWO_VADDR
(
ioaddr
))))
{
release_mem_region
(
ioaddr
,
NE_IO_EXTENT
*
2
);
kfree
(
dev
);
free_netdev
(
dev
);
return
err
;
}
err
=
0
;
...
...
@@ -129,6 +130,7 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
const
char
*
name
,
unsigned
long
ioaddr
)
{
int
i
;
int
err
;
unsigned
char
SA_prom
[
32
];
int
start_page
,
stop_page
;
static
u32
zorro8390_offsets
[
16
]
=
{
...
...
@@ -198,6 +200,7 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if
(
ethdev_init
(
dev
))
{
printk
(
"Unable to get memory for dev->priv.
\n
"
);
free_irq
(
IRQ_AMIGA_PORTS
,
dev
);
return
-
ENOMEM
;
}
...
...
@@ -232,7 +235,12 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
root_zorro8390_dev
=
dev
;
#endif
NS8390_init
(
dev
,
0
);
return
0
;
err
=
register_netdev
(
dev
);
if
(
err
)
{
kfree
(
dev
->
priv
);
free_irq
(
IRQ_AMIGA_PORTS
,
dev
);
}
return
err
;
}
static
int
zorro8390_open
(
struct
net_device
*
dev
)
...
...
@@ -413,6 +421,7 @@ static void __exit zorro8390_cleanup(void)
unregister_netdev
(
dev
);
free_irq
(
IRQ_AMIGA_PORTS
,
dev
);
release_mem_region
(
ZTWO_PADDR
(
dev
->
base_addr
),
NE_IO_EXTENT
*
2
);
kfree
(
dev
->
priv
);
free_netdev
(
dev
);
root_zorro8390_dev
=
next
;
}
...
...
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