From: Florian Fainelli <f.faine...@gmail.com> Date: Sat, 27 May 2017 10:42:25 -0700
> Some Ethernet drivers will attach/connect to a PHY device before calling > register_netdevice() which is responsible for calling > netdev_register_kobject() > which would do the network device's kobject initialization. In such a case, > sysfs_create_link() would return -ENOENT because the network device's kobject > is not ready yet, and we would fail to connect to the PHY device. > > In order to keep things simple and symetrical, we just take the success path > as > indicative of the ability to access the network device's kobject, and create > the second link if that's the case. > > Fixes: 5568363f0cb3 ("net: phy: Create sysfs reciprocal links for > attached_dev/phydev") > Reported-by: Woojung Hung <woojung....@microchip.com> > Signed-off-by: Florian Fainelli <f.faine...@gmail.com> > --- > Changes in v2: > - make sure phydev->sysfs_links is set to false before setting again Applied, thanks Florian.