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
fe12455c
Commit
fe12455c
authored
Mar 02, 2005
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ARM] Use ecard_{request,release}_resources() for resource management
Signed-off-by:
Russell King
<
rmk@arm.linux.org.uk
>
parent
7af60616
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
36 deletions
+27
-36
drivers/net/arm/ether1.c
drivers/net/arm/ether1.c
+13
-18
drivers/net/arm/ether3.c
drivers/net/arm/ether3.c
+14
-18
No files found.
drivers/net/arm/ether1.c
View file @
fe12455c
...
...
@@ -997,15 +997,18 @@ static int __devinit
ether1_probe
(
struct
expansion_card
*
ec
,
const
struct
ecard_id
*
id
)
{
struct
net_device
*
dev
;
struct
ether1_priv
*
priv
;
int
i
,
ret
=
0
;
ether1_banner
();
ret
=
ecard_request_resources
(
ec
);
if
(
ret
)
goto
out
;
dev
=
alloc_etherdev
(
sizeof
(
struct
ether1_priv
));
if
(
!
dev
)
{
ret
=
-
ENOMEM
;
goto
out
;
goto
release
;
}
SET_MODULE_OWNER
(
dev
);
...
...
@@ -1013,15 +1016,9 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
dev
->
base_addr
=
ecard_address
(
ec
,
ECARD_IOC
,
ECARD_FAST
);
dev
->
irq
=
ec
->
irq
;
/*
* these will not fail - the nature of the bus ensures this
*/
request_region
(
dev
->
base_addr
,
16
,
dev
->
name
);
request_region
(
dev
->
base_addr
+
0x800
,
4096
,
dev
->
name
);
if
((
priv
(
dev
)
->
bus_type
=
ether1_reset
(
dev
))
==
0
)
{
ret
=
-
ENODEV
;
goto
releas
e
;
goto
fre
e
;
}
for
(
i
=
0
;
i
<
6
;
i
++
)
...
...
@@ -1029,7 +1026,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
if
(
ether1_init_2
(
dev
))
{
ret
=
-
ENODEV
;
goto
releas
e
;
goto
fre
e
;
}
dev
->
open
=
ether1_open
;
...
...
@@ -1042,7 +1039,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
ret
=
register_netdev
(
dev
);
if
(
ret
)
goto
releas
e
;
goto
fre
e
;
printk
(
KERN_INFO
"%s: ether1 in slot %d, "
,
dev
->
name
,
ec
->
slot_no
);
...
...
@@ -1053,11 +1050,11 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
ecard_set_drvdata
(
ec
,
dev
);
return
0
;
release:
release_region
(
dev
->
base_addr
,
16
);
release_region
(
dev
->
base_addr
+
0x800
,
4096
);
free:
free_netdev
(
dev
);
out:
release:
ecard_release_resources
(
ec
);
out:
return
ret
;
}
...
...
@@ -1068,10 +1065,8 @@ static void __devexit ether1_remove(struct expansion_card *ec)
ecard_set_drvdata
(
ec
,
NULL
);
unregister_netdev
(
dev
);
release_region
(
dev
->
base_addr
,
16
);
release_region
(
dev
->
base_addr
+
0x800
,
4096
);
free_netdev
(
dev
);
ecard_release_resources
(
ec
);
}
static
const
struct
ecard_id
ether1_ids
[]
=
{
...
...
drivers/net/arm/ether3.c
View file @
fe12455c
...
...
@@ -804,10 +804,14 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
ether3_banner
();
ret
=
ecard_request_resources
(
ec
);
if
(
ret
)
goto
out
;
dev
=
alloc_etherdev
(
sizeof
(
struct
dev_priv
));
if
(
!
dev
)
{
ret
=
-
ENOMEM
;
goto
out
;
goto
release
;
}
SET_MODULE_OWNER
(
dev
);
...
...
@@ -818,14 +822,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
goto
free
;
}
/*
* this will not fail - the nature of the bus ensures this
*/
if
(
!
request_region
(
dev
->
base_addr
,
128
,
dev
->
name
))
{
ret
=
-
EBUSY
;
goto
free
;
}
init_timer
(
&
priv
(
dev
)
->
timer
);
/* Reset card...
...
...
@@ -850,13 +846,13 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
case
BUS_UNKNOWN
:
printk
(
KERN_ERR
"%s: unable to identify bus width
\n
"
,
dev
->
name
);
ret
=
-
ENODEV
;
goto
f
ailed
;
goto
f
ree
;
case
BUS_8
:
printk
(
KERN_ERR
"%s: %s found, but is an unsupported "
"8-bit card
\n
"
,
dev
->
name
,
name
);
ret
=
-
ENODEV
;
goto
f
ailed
;
goto
f
ree
;
default:
break
;
...
...
@@ -864,7 +860,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
if
(
ether3_init_2
(
dev
))
{
ret
=
-
ENODEV
;
goto
f
ailed
;
goto
f
ree
;
}
dev
->
open
=
ether3_open
;
...
...
@@ -877,7 +873,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
ret
=
register_netdev
(
dev
);
if
(
ret
)
goto
f
ailed
;
goto
f
ree
;
printk
(
"%s: %s in slot %d, "
,
dev
->
name
,
name
,
ec
->
slot_no
);
for
(
i
=
0
;
i
<
6
;
i
++
)
...
...
@@ -886,11 +882,11 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
ecard_set_drvdata
(
ec
,
dev
);
return
0
;
failed:
release_region
(
dev
->
base_addr
,
128
);
free:
free:
free_netdev
(
dev
);
out:
release:
ecard_release_resources
(
ec
);
out:
return
ret
;
}
...
...
@@ -901,8 +897,8 @@ static void __devexit ether3_remove(struct expansion_card *ec)
ecard_set_drvdata
(
ec
,
NULL
);
unregister_netdev
(
dev
);
release_region
(
dev
->
base_addr
,
128
);
free_netdev
(
dev
);
ecard_release_resources
(
ec
);
}
static
const
struct
ecard_id
ether3_ids
[]
=
{
...
...
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