9
0
Fork 0

net: phy: check if a phy already has an ethernet device

If during a phy_device_connect a phy already has an ehternet device
this can only mean it's already attached to another device. return -EBUSY
in this case.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-12-11 10:56:29 +01:00
parent 664694d9f7
commit d023d690fc
1 changed files with 3 additions and 0 deletions

View File

@ -281,6 +281,9 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
}
}
if (dev->attached_dev)
return -EBUSY;
dev->interface = interface;
dev->dev_flags = flags;