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:
parent
664694d9f7
commit
d023d690fc
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue