diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2013-12-20 05:16:08 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-21 05:48:48 +0400 |
commit | 7befa6abe09c84269b8af614a166409090346cf8 (patch) | |
tree | f62842358cffb36a5df5a1f28e8e1cb820fb9b35 /drivers/net/ethernet/broadcom/b44.c | |
parent | 5ab6329c5224d8135d76da18066edf3395f679f5 (diff) | |
download | linux-7befa6abe09c84269b8af614a166409090346cf8.tar.xz |
b44: abort when no PHY is available at all
When the phy address is 31, this means that there is no PHY connected
to this MAC at all, no internal and no external PHY. Reading these PHY
registers causes a system reset on some routers.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/b44.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/b44.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c index 5c05d150f67b..09e9e97558b8 100644 --- a/drivers/net/ethernet/broadcom/b44.c +++ b/drivers/net/ethernet/broadcom/b44.c @@ -2206,6 +2206,12 @@ static int b44_init_one(struct ssb_device *sdev, goto err_out_powerdown; } + if (bp->phy_addr == B44_PHY_ADDR_NO_PHY) { + dev_err(sdev->dev, "No PHY present on this MAC, aborting\n"); + err = -ENODEV; + goto err_out_powerdown; + } + bp->mii_if.dev = dev; bp->mii_if.mdio_read = b44_mii_read; bp->mii_if.mdio_write = b44_mii_write; |