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
7aa6a478
Commit
7aa6a478
authored
May 04, 2009
by
Krzysztof Hałasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IXP4xx: complete Ethernet netdev setup before calling register_netdev().
Signed-off-by:
Krzysztof Hałasa
<
khc@pm.waw.pl
>
parent
3ba8c792
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
drivers/net/arm/ixp4xx_eth.c
drivers/net/arm/ixp4xx_eth.c
+13
-12
No files found.
drivers/net/arm/ixp4xx_eth.c
View file @
7aa6a478
...
...
@@ -1189,15 +1189,10 @@ static int __devinit eth_init_one(struct platform_device *pdev)
goto
err_free
;
}
if
(
register_netdev
(
dev
))
{
err
=
-
EIO
;
goto
err_npe_rel
;
}
port
->
mem_res
=
request_mem_region
(
regs_phys
,
REGS_SIZE
,
dev
->
name
);
if
(
!
port
->
mem_res
)
{
err
=
-
EBUSY
;
goto
err_
unreg
;
goto
err_
npe_rel
;
}
port
->
plat
=
plat
;
...
...
@@ -1215,20 +1210,25 @@ static int __devinit eth_init_one(struct platform_device *pdev)
snprintf
(
phy_id
,
BUS_ID_SIZE
,
PHY_ID_FMT
,
"0"
,
plat
->
phy
);
port
->
phydev
=
phy_connect
(
dev
,
phy_id
,
&
ixp4xx_adjust_link
,
0
,
PHY_INTERFACE_MODE_MII
);
if
(
IS_ERR
(
port
->
phydev
))
{
printk
(
KERN_ERR
"%s: Could not attach to PHY
\n
"
,
dev
->
name
);
return
PTR_ERR
(
port
->
phydev
);
}
if
((
err
=
IS_ERR
(
port
->
phydev
)))
goto
err_free_mem
;
port
->
phydev
->
irq
=
PHY_POLL
;
if
((
err
=
register_netdev
(
dev
)))
goto
err_phy_dis
;
printk
(
KERN_INFO
"%s: MII PHY %i on %s
\n
"
,
dev
->
name
,
plat
->
phy
,
npe_name
(
port
->
npe
));
return
0
;
err_unreg:
unregister_netdev
(
dev
);
err_phy_dis:
phy_disconnect
(
port
->
phydev
);
err_free_mem:
npe_port_tab
[
NPE_ID
(
port
->
id
)]
=
NULL
;
platform_set_drvdata
(
pdev
,
NULL
);
release_resource
(
port
->
mem_res
);
err_npe_rel:
npe_release
(
port
->
npe
);
err_free:
...
...
@@ -1242,6 +1242,7 @@ static int __devexit eth_remove_one(struct platform_device *pdev)
struct
port
*
port
=
netdev_priv
(
dev
);
unregister_netdev
(
dev
);
phy_disconnect
(
port
->
phydev
);
npe_port_tab
[
NPE_ID
(
port
->
id
)]
=
NULL
;
platform_set_drvdata
(
pdev
,
NULL
);
npe_release
(
port
->
npe
);
...
...
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