diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-10 13:46:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-10 13:46:45 -0400 |
commit | 2ad20802b759cc2d16dc9470fa15874610d21714 (patch) | |
tree | f9a0d657a3162bb87ff31d0c580b7910938fd9d1 /drivers/net/arm/ixp4xx_eth.c | |
parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) | |
parent | e1cc1c578055d20d36e084e324001fb5e0355a71 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits)
bonding: fix panic if initialization fails
IXP4xx: complete Ethernet netdev setup before calling register_netdev().
IXP4xx: use "ENODEV" instead of "ENOSYS" in module initialization.
ipvs: Fix IPv4 FWMARK virtual services
ipv4: Make INET_LRO a bool instead of tristate.
net: remove stale reference to fastroute from Kconfig help text
net: update skb_recycle_check() for hardware timestamping changes
bnx2: Fix panic in bnx2_poll_work().
net-sched: fix bfifo default limit
igb: resolve panic on shutdown when SR-IOV is enabled
wimax: oops: wimax_dev_add() is the only one that can initialize the state
wimax: fix oops if netlink fails to add attribute
Bluetooth: Move dev_set_name() to a context that can sleep
netfilter: ctnetlink: fix wrong message type in user updates
netfilter: xt_cluster: fix use of cluster match with 32 nodes
netfilter: ip6t_ipv6header: fix match on packets ending with NEXTHDR_NONE
netfilter: add missing linux/types.h include to xt_LED.h
mac80211: pid, fix memory corruption
mac80211: minstrel, fix memory corruption
cfg80211: fix comment on regulatory hint processing
...
Diffstat (limited to 'drivers/net/arm/ixp4xx_eth.c')
-rw-r--r-- | drivers/net/arm/ixp4xx_eth.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/net/arm/ixp4xx_eth.c b/drivers/net/arm/ixp4xx_eth.c index 448487e22fa..a740053d3af 100644 --- a/drivers/net/arm/ixp4xx_eth.c +++ b/drivers/net/arm/ixp4xx_eth.c | |||
@@ -338,12 +338,12 @@ static int ixp4xx_mdio_register(void) | |||
338 | if (cpu_is_ixp43x()) { | 338 | if (cpu_is_ixp43x()) { |
339 | /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */ | 339 | /* IXP43x lacks NPE-B and uses NPE-C for MII PHY access */ |
340 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH)) | 340 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEC_ETH)) |
341 | return -ENOSYS; | 341 | return -ENODEV; |
342 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT; | 342 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthC_BASE_VIRT; |
343 | } else { | 343 | } else { |
344 | /* All MII PHY accesses use NPE-B Ethernet registers */ | 344 | /* All MII PHY accesses use NPE-B Ethernet registers */ |
345 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0)) | 345 | if (!(ixp4xx_read_feature_bits() & IXP4XX_FEATURE_NPEB_ETH0)) |
346 | return -ENOSYS; | 346 | return -ENODEV; |
347 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT; | 347 | mdio_regs = (struct eth_regs __iomem *)IXP4XX_EthB_BASE_VIRT; |
348 | } | 348 | } |
349 | 349 | ||
@@ -1174,7 +1174,7 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1174 | regs_phys = IXP4XX_EthC_BASE_PHYS; | 1174 | regs_phys = IXP4XX_EthC_BASE_PHYS; |
1175 | break; | 1175 | break; |
1176 | default: | 1176 | default: |
1177 | err = -ENOSYS; | 1177 | err = -ENODEV; |
1178 | goto err_free; | 1178 | goto err_free; |
1179 | } | 1179 | } |
1180 | 1180 | ||
@@ -1189,15 +1189,10 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1189 | goto err_free; | 1189 | goto err_free; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | if (register_netdev(dev)) { | ||
1193 | err = -EIO; | ||
1194 | goto err_npe_rel; | ||
1195 | } | ||
1196 | |||
1197 | port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name); | 1192 | port->mem_res = request_mem_region(regs_phys, REGS_SIZE, dev->name); |
1198 | if (!port->mem_res) { | 1193 | if (!port->mem_res) { |
1199 | err = -EBUSY; | 1194 | err = -EBUSY; |
1200 | goto err_unreg; | 1195 | goto err_npe_rel; |
1201 | } | 1196 | } |
1202 | 1197 | ||
1203 | port->plat = plat; | 1198 | port->plat = plat; |
@@ -1215,20 +1210,25 @@ static int __devinit eth_init_one(struct platform_device *pdev) | |||
1215 | snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); | 1210 | snprintf(phy_id, BUS_ID_SIZE, PHY_ID_FMT, "0", plat->phy); |
1216 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, | 1211 | port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, |
1217 | PHY_INTERFACE_MODE_MII); | 1212 | PHY_INTERFACE_MODE_MII); |
1218 | if (IS_ERR(port->phydev)) { | 1213 | if ((err = IS_ERR(port->phydev))) |
1219 | printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); | 1214 | goto err_free_mem; |
1220 | return PTR_ERR(port->phydev); | ||
1221 | } | ||
1222 | 1215 | ||
1223 | port->phydev->irq = PHY_POLL; | 1216 | port->phydev->irq = PHY_POLL; |
1224 | 1217 | ||
1218 | if ((err = register_netdev(dev))) | ||
1219 | goto err_phy_dis; | ||
1220 | |||
1225 | printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, | 1221 | printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, |
1226 | npe_name(port->npe)); | 1222 | npe_name(port->npe)); |
1227 | 1223 | ||
1228 | return 0; | 1224 | return 0; |
1229 | 1225 | ||
1230 | err_unreg: | 1226 | err_phy_dis: |
1231 | unregister_netdev(dev); | 1227 | phy_disconnect(port->phydev); |
1228 | err_free_mem: | ||
1229 | npe_port_tab[NPE_ID(port->id)] = NULL; | ||
1230 | platform_set_drvdata(pdev, NULL); | ||
1231 | release_resource(port->mem_res); | ||
1232 | err_npe_rel: | 1232 | err_npe_rel: |
1233 | npe_release(port->npe); | 1233 | npe_release(port->npe); |
1234 | err_free: | 1234 | err_free: |
@@ -1242,6 +1242,7 @@ static int __devexit eth_remove_one(struct platform_device *pdev) | |||
1242 | struct port *port = netdev_priv(dev); | 1242 | struct port *port = netdev_priv(dev); |
1243 | 1243 | ||
1244 | unregister_netdev(dev); | 1244 | unregister_netdev(dev); |
1245 | phy_disconnect(port->phydev); | ||
1245 | npe_port_tab[NPE_ID(port->id)] = NULL; | 1246 | npe_port_tab[NPE_ID(port->id)] = NULL; |
1246 | platform_set_drvdata(pdev, NULL); | 1247 | platform_set_drvdata(pdev, NULL); |
1247 | npe_release(port->npe); | 1248 | npe_release(port->npe); |