From 0132b9ab6e6593d1fd259cdd26261f184c436fdd Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Wed, 7 Oct 2015 21:19:29 -0700 Subject: net: phy: Don't create phy device when there is no phy In get_phy_device_by_mask(), when no phy is found, we should not create any phy device. Signed-off-by: Bin Meng Acked-by: Joe Hershberger --- drivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/phy') diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index a6023f1..4063894 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -672,7 +672,8 @@ static struct phy_device *get_phy_device_by_mask(struct mii_dev *bus, return phydev; } printf("Phy %d not found\n", ffs(phy_mask) - 1); - return phy_device_create(bus, ffs(phy_mask) - 1, 0xffffffff, interface); + + return NULL; } /** -- cgit v1.1