diff mbox

[U-Boot,v2,1/3] net: phy: Don't create phy device when there is no phy

Message ID 1444277971-31252-1-git-send-email-bmeng.cn@gmail.com
State Accepted
Delegated to: Joe Hershberger
Headers show

Commit Message

Bin Meng Oct. 8, 2015, 4:19 a.m. UTC
In get_phy_device_by_mask(), when no phy is found, we should not
create any phy device.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

---

Changes in v2:
- Rebase on u-boot/master

 drivers/net/phy/phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Joe Hershberger Oct. 29, 2015, 7:29 p.m. UTC | #1
On Wed, Oct 7, 2015 at 11:19 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> In get_phy_device_by_mask(), when no phy is found, we should not
> create any phy device.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>

Applied to u-boot-net/master, thanks!
-Joe
diff mbox

Patch

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;
 }
 
 /**