devm_phy_optional_get(9)
πΈ devm_phy_optional_get(9) πΈ
okay so bestie, welcome to the kernel API manual page for devm_phy_optional_get(9) β this is the devm_phy_optional_get one, fr fr, in the Kernel API Manual. yes it's the same name twice, the kernel is like that, we love a self-titled era. π
β¨ NAME β¨
devm_phy_optional_get β lookup and obtain a reference to an optional phy. that's it, that's the whole vibe. the word "optional" is doing SO much work here, remember it. π
π¦ SYNOPSIS π¦
struct phy * devm_phy_optional_get (struct device *dev , const char
*string );
π ARGUMENTS π
devβ the device that requests this phy. like, who's asking. it's you. you're the device. πstringβ the phy name as given in the dt data, or the phy device name for the non-dt case. iykyk which one applies to you. π
π₯ DESCRIPTION π₯
so what does it actually DO. Gets the phy using phy_get, and then associates a device with it using devres. π«Ά
On driver detach, release function is invoked on the devres data, then, devres data is freed. automatic cleanup, no cap, that's the whole devm lifestyle. β¨
Now the iconique part β the way this differs to devm_phy_get: if the phy does not exist, it is not considered an error, and -ENODEV will not be returned. π Instead the NULL phy is returned, which can be passed to all other phy consumer calls. so you literally just hold your little NULL and keep going, slay. π
ngl bestie, do NOT read "optional" and then panic about NULL checking β the manpage says the NULL phy can be passed to all other phy consumer calls, so that's the deal. just don't mix this up withdevm_phy_get, which will absolutely hand you the-ENODEV. π
π SEE ALSO π
Kernel file ./drivers/phy/phy-core.c β that's where all of this lives, go look, it's giving source-of-truth. π
phy_create_lookup(9)phy_remove_lookup(9)phy_init(9)phy_exit(9)phy_power_on(9)phy_power_off(9)phy_calibrate(9)phy_notify_connect(9)phy_notify_disconnect(9)phy_notify_state(9)phy_configure(9)phy_validate(9)_of_phy_get(9)of_phy_get(9)of_phy_put(9)phy_put(9)devm_phy_put(9)of_phy_simple_xlate(9)phy_get(9)devm_phy_get(9)devm_of_phy_get(9)devm_of_phy_optional_get(9)devm_of_phy_get_by_index(9)phy_create(9)devm_phy_create(9)phy_destroy(9)devm_phy_destroy(9)__of_phy_provider_register(9)__devm_of_phy_provider_register(9)of_phy_provider_unregister(9)devm_of_phy_provider_unregister(9)phy_release(9)
okay that's the whole page, no skips, no cuts, we ate. π
and for the cute sign-off: this one's filed under ./drivers/phy (that's the source/version bestie), dated October 2026, and it goes out as devm_phy_optional_get(9) β same name, top and bottom, main character energy from start to finish. mwah. π
π§ββοΈ
π¦ 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