sfp_bus_put(9)
π sfp_bus_put(9) β from the Kernel API Manual, bestie
okay so you found a function called sfp_bus_put and you're like "what does putting a bus even mean" β don't worry, it's actually so simple and honestly kind of iconic. it's a refcount drop. that's the whole vibe. π¦
β¨ NAME β¨
sfp_bus_put β put a reference on the &struct sfp_bus π (yes, that's literally the job, no cap)
πΈ SYNOPSIS πΈ
void sfp_bus_put (struct sfp_bus *bus );
that's it. that's the whole function signature. one arg, void return, main character energy only. β¨
π ARGUMENTS π
busβ thestruct sfp_busthat you got fromsfp_bus_find_fwnode. like, the one you already found earlier with that other function. you're not inventing a new one here, you're just handing back the one you're holding. π«Ά
π DESCRIPTION π
so here's the tea: sfp_bus_put puts a reference on the struct sfp_bus, and β this is the important part β it frees the underlying structure if this was the last reference. π₯
like, refcounting is basically a group chat where everyone who's still interested keeps the chat alive. sfp_bus_put is you leaving the chat. if you were the last one in there, the chat gets deleted. if other people are still in it, the chat lives on, no drama. π
so yeah β drop your reference, and maybe it also frees everything. you don't get to decide which; the refcount decides. slay. π
β SEE ALSO β
- Kernel file
./drivers/net/phy/sfp-bus.cπ§ struct sfp_bus(9)sfp_select_interface(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_find_fwnode(9)β this one's the finder, you'll want it before the put πsfp_bus_add_upstream(9)sfp_bus_del_upstream(9)sfp_get_name(9)
lowkey read thesfp_bus_find_fwnode(9)page first β that's where yourbuscomes from, iykyk. π
okay bye bestie, go forth and release your references responsibly π
β with love from ./drivers/net/phy, dated October 2026, page sfp_bus_put(9) πΈππ¦
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms