sfp_bus_find_fwnode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sfp_bus_find_fwnode ✨

okay so this is the sfp_bus_find_fwnode(9) page from the Kernel API Manual, and bestie it's literally about finding your SFP bus πŸ¦‹


πŸ’… NAME πŸ’…

sfp_bus_find_fwnode β€” parse and locate the SFP bus from fwnode 🌸


πŸŽ€ SYNOPSIS πŸŽ€

struct sfp_bus * sfp_bus_find_fwnode (const struct fwnode_handle *fwnode
);

🌼 ARGUMENTS 🌼

  • fwnode β€” the firmware node for the parent device, aka the MAC or the PHY. that's the thing we're snooping through πŸ‘€

πŸ”₯ DESCRIPTION πŸ”₯

So what this does: it parses the parent device's firmware node looking for an SFP bus, and then it locates the sfp_bus structure β€” and it increments its reference count while it's at it, bestie, so don't just wander off with it 😭

You must put that reference back via sfp_bus_put when you're done. no cap, that's the deal 🫢

Now, the original page lists these error bullets right here in the description section, so here they are, no edits:

  • corresponding to the errors detailed for fwnode_property_get_reference_args.
  • -ENOMEM if we failed to allocate the bus.
  • an error from the upstream's connect_phy method.

πŸ‘‘ RETURN πŸ‘‘

  • on success, a pointer to the sfp_bus structure,
  • NULL if no SFP is specified,
  • on failure, an error pointer value:

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/phy/sfp-bus.c, plus all these icons: struct sfp_bus(9), sfp_select_interface(9), sfp_bus_put(9), sfp_get_module_info(9), sfp_get_module_eeprom(9), sfp_get_module_eeprom_by_page(9), sfp_upstream_start(9), sfp_upstream_stop(9), sfp_upstream_set_signal_rate(9), sfp_bus_add_upstream(9), sfp_bus_del_upstream(9), sfp_get_name(9) ⭐


πŸ’€ friendly reminder from your girl: that reference count is not a vibe, it's a contract. sfp_bus_put it. periodt.

and that's the whole page!! mwah πŸ’– this one came from ./drivers/net/phy, dated October 2026, and it's the sfp_bus_find_fwnode(9) manual page β€” go read the source file if you want the behind-the-scenes, iykyk πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from