> +/**
> + * fwnode_mdio_find_bus - Given an mii_bus fwnode, find the mii_bus.
> + * @mdio_bus_fwnode: fwnode of the mii_bus.
> + *
> + * Returns a reference to the mii_bus, or NULL if none found.  The
> + * embedded struct device will have its reference count incremented,
> + * and this must be put once the bus is finished with.

> +struct phy_device *phy_find_by_fwnode(struct fwnode_handle *fwnode)
> +{
> +     struct fwnode_handle *fwnode_mdio;
> +     struct mii_bus *mdio;
> +     int addr;
> +     int err;
> +
> +     fwnode_mdio = fwnode_find_reference(fwnode, "mdio-handle", 0);
> +     mdio = fwnode_mdio_find_bus(fwnode_mdio);

You don't seem to release the reference on the device anywhere. Is
that a problem?

     Andrew

Reply via email to