drivers/net/mdio/fwnode_mdio.c

Source file repositories/reference/linux-study-clean/drivers/net/mdio/fwnode_mdio.c

File Facts

System
Linux kernel
Corpus path
drivers/net/mdio/fwnode_mdio.c
Extension
.c
Size
4338 bytes
Lines
190
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (rc) {
			phy->mdio.dev.fwnode = NULL;
			fwnode_handle_put(child);
			goto clean_phy;
		}
	} else if (is_of_node(child)) {
		rc = fwnode_mdiobus_phy_device_register(bus, phy, child, addr);
		if (rc)
			goto clean_phy;
	}

	psec = fwnode_find_pse_control(child, phy);
	if (IS_ERR(psec)) {
		rc = PTR_ERR(psec);
		goto unregister_phy;
	}

	phy->psec = psec;

	/* phy->mii_ts may already be defined by the PHY driver. A
	 * mii_timestamper probed via the device tree will still have
	 * precedence.
	 */
	if (mii_ts)
		phy->mii_ts = mii_ts;

	return 0;

unregister_phy:
	if (is_acpi_node(child) || is_of_node(child))
		phy_device_remove(phy);
clean_phy:
	phy_device_free(phy);
clean_mii_ts:
	unregister_mii_timestamper(mii_ts);

	return rc;
}
EXPORT_SYMBOL(fwnode_mdiobus_register_phy);

Annotation

Implementation Notes