> Yes, this is what I am using right now:
>
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -920,11 +920,6 @@ int phy_attach_direct(struct net_device *dev,
> struct phy_device *phydev,
> return -EIO;
> }
>
> - if (!try_module_get(d->driver->owner)) {
> - dev_err(&dev->dev, "failed to get the device driver
> module\n");
> - return -EIO;
> - }
> -
> get_device(d);
>
> /* Assume that if there is no driver, that it doesn't
> @@ -946,6 +941,11 @@ int phy_attach_direct(struct net_device *dev,
> struct phy_device *phydev,
> goto error;
> }
>
> + if (!try_module_get(d->driver->owner)) {
> + dev_err(&dev->dev, "failed to get the device driver
> module\n");
> + return -EIO;
> + }
> +
> if (phydev->attached_dev) {
> dev_err(&dev->dev, "PHY already attached\n");
> err = -EBUSY;
>
> Would you like me to submit this one?
I'm just wondering about the get_device(d); Does the ordering matter
here? Lets wait for Florian before submitting a patch.
Andrew