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)
...
@@ -103,18 +103,19 @@ static int __init zorro8390_probe(void)
continue
;
continue
;
board
=
z
->
resource
.
start
;
board
=
z
->
resource
.
start
;
ioaddr
=
board
+
cards
[
i
].
offset
;
ioaddr
=
board
+
cards
[
i
].
offset
;
dev
=
init_etherdev
(
0
,
0
);
dev
=
alloc_etherdev
(
0
);
SET_MODULE_OWNER
(
dev
);
if
(
!
dev
)
if
(
!
dev
)
return
-
ENOMEM
;
return
-
ENOMEM
;
dev
->
priv
=
NULL
;
SET_MODULE_OWNER
(
dev
);
if
(
!
request_mem_region
(
ioaddr
,
NE_IO_EXTENT
*
2
,
dev
->
name
))
{
if
(
!
request_mem_region
(
ioaddr
,
NE_IO_EXTENT
*
2
,
dev
->
name
))
{
kfree
(
dev
);
free_netdev
(
dev
);
continue
;
continue
;
}
}
if
((
err
=
zorro8390_init
(
dev
,
board
,
cards
[
i
].
name
,
if
((
err
=
zorro8390_init
(
dev
,
board
,
cards
[
i
].
name
,
ZTWO_VADDR
(
ioaddr
))))
{
ZTWO_VADDR
(
ioaddr
))))
{
release_mem_region
(
ioaddr
,
NE_IO_EXTENT
*
2
);
release_mem_region
(
ioaddr
,
NE_IO_EXTENT
*
2
);
kfree
(
dev
);
free_netdev
(
dev
);
return
err
;
return
err
;
}
}
err
=
0
;
err
=
0
;
...
@@ -129,6 +130,7 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
...
@@ -129,6 +130,7 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
const
char
*
name
,
unsigned
long
ioaddr
)
const
char
*
name
,
unsigned
long
ioaddr
)
{
{
int
i
;
int
i
;
int
err
;
unsigned
char
SA_prom
[
32
];
unsigned
char
SA_prom
[
32
];
int
start_page
,
stop_page
;
int
start_page
,
stop_page
;
static
u32
zorro8390_offsets
[
16
]
=
{
static
u32
zorro8390_offsets
[
16
]
=
{
...
@@ -198,6 +200,7 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
...
@@ -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. */
/* Allocate dev->priv and fill in 8390 specific dev fields. */
if
(
ethdev_init
(
dev
))
{
if
(
ethdev_init
(
dev
))
{
printk
(
"Unable to get memory for dev->priv.
\n
"
);
printk
(
"Unable to get memory for dev->priv.
\n
"
);
free_irq
(
IRQ_AMIGA_PORTS
,
dev
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
...
@@ -232,7 +235,12 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
...
@@ -232,7 +235,12 @@ static int __init zorro8390_init(struct net_device *dev, unsigned long board,
root_zorro8390_dev
=
dev
;
root_zorro8390_dev
=
dev
;
#endif
#endif
NS8390_init
(
dev
,
0
);
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
)
static
int
zorro8390_open
(
struct
net_device
*
dev
)
...
@@ -413,6 +421,7 @@ static void __exit zorro8390_cleanup(void)
...
@@ -413,6 +421,7 @@ static void __exit zorro8390_cleanup(void)
unregister_netdev
(
dev
);
unregister_netdev
(
dev
);
free_irq
(
IRQ_AMIGA_PORTS
,
dev
);
free_irq
(
IRQ_AMIGA_PORTS
,
dev
);
release_mem_region
(
ZTWO_PADDR
(
dev
->
base_addr
),
NE_IO_EXTENT
*
2
);
release_mem_region
(
ZTWO_PADDR
(
dev
->
base_addr
),
NE_IO_EXTENT
*
2
);
kfree
(
dev
->
priv
);
free_netdev
(
dev
);
free_netdev
(
dev
);
root_zorro8390_dev
=
next
;
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