Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171965
b: refs/heads/master
c: 47c3d19
h: refs/heads/master
i:
  171963: d3147f7
v: v3
  • Loading branch information
Steve Hodgson authored and David S. Miller committed Nov 29, 2009
1 parent 37d945c commit df84818
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fdaa9aed21c8c8b529f3c94a5ffa138bf3360b75
refs/heads/master: 47c3d19f60da7cc018781744b1ffb3b557373e7f
22 changes: 8 additions & 14 deletions trunk/drivers/net/sfc/qt202x_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,33 +138,27 @@ static int qt202x_reset_phy(struct efx_nic *efx)
static int qt202x_phy_init(struct efx_nic *efx)
{
struct qt202x_phy_data *phy_data;
u32 devid = efx_mdio_read_id(efx, MDIO_MMD_PHYXS);
u32 devid;
int rc;

rc = qt202x_reset_phy(efx);
if (rc) {
EFX_ERR(efx, "PHY init failed\n");
return rc;
}

phy_data = kzalloc(sizeof(struct qt202x_phy_data), GFP_KERNEL);
if (!phy_data)
return -ENOMEM;
efx->phy_data = phy_data;

devid = efx_mdio_read_id(efx, MDIO_MMD_PHYXS);
EFX_INFO(efx, "PHY ID reg %x (OUI %06x model %02x revision %x)\n",
devid, efx_mdio_id_oui(devid), efx_mdio_id_model(devid),
efx_mdio_id_rev(devid));

phy_data->phy_mode = efx->phy_mode;

rc = qt202x_reset_phy(efx);

EFX_INFO(efx, "PHY init %s.\n",
rc ? "failed" : "successful");
if (rc < 0)
goto fail;

return 0;

fail:
kfree(efx->phy_data);
efx->phy_data = NULL;
return rc;
}

static int qt202x_link_ok(struct efx_nic *efx)
Expand Down

0 comments on commit df84818

Please sign in to comment.