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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/dev_printk.hlinux/fwnode_mdio.hlinux/of.hlinux/phy.hlinux/pse-pd/pse.h
Detected Declarations
function fwnode_find_pse_controlfunction fwnode_find_mii_timestamperfunction fwnode_mdiobus_phy_device_registerfunction fwnode_mdiobus_register_phyexport fwnode_mdiobus_phy_device_registerexport fwnode_mdiobus_register_phy
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
- Immediate include surface: `linux/acpi.h`, `linux/dev_printk.h`, `linux/fwnode_mdio.h`, `linux/of.h`, `linux/phy.h`, `linux/pse-pd/pse.h`.
- Detected declarations: `function fwnode_find_pse_control`, `function fwnode_find_mii_timestamper`, `function fwnode_mdiobus_phy_device_register`, `function fwnode_mdiobus_register_phy`, `export fwnode_mdiobus_phy_device_register`, `export fwnode_mdiobus_register_phy`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.