Thread (10 messages) 10 messages, 3 authors, 2020-07-08

Re: [net-next PATCH v3 3/5] net: phy: introduce phy_find_by_fwnode()

From: Andrew Lunn <andrew@lunn.ch>
Date: 2020-07-08 18:58:44
Also in: linux-acpi

+/**
+ * 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help