devm_mux_sta...nal_selected(9)
π devm_mux_sta...nal_selected(9)
okay so this is a page from the Kernel API Manual (the 9 section, the kernel-doc girlies know) and honestly? it's a little baddie. let's get into it π
β¨ NAME β¨
devm_mux_state_get_optional_selected β grab the optional mux-state for a device, but likeβ¦ with resource management. devm-coded. no cap.
π¦ SYNOPSIS π¦
struct mux_state * devm_mux_state_get_optional_selected (struct device
*dev , const char *mux_name );
that's the whole vibe. one function, two args, slays. β¨
π ARGUMENTS π
devβ the device that's out here needing a mux-state. it's giving "please give me a mux-state, i'm literally a device."mux_nameβ the name that identifies the mux-state. it's the β¨identifyingβ¨ name. yes that's the whole description, it's a short king. π
π₯ RETURN π₯
so here's the vibe check on what you get back:
- a pointer to the mux-state on success π
- an
ERR_PTRwith a negativeerrnoon error π NULLif the mux doesn't exist β she's not here, she's not coming π
πΈ DESCRIPTION πΈ
the returned mux-state (if valid) is already selected. no extra steps bestie, it's pre-selected for you. main character energy only.
and the best part?? the mux-state will automatically be deselected and freed on release. devm said "i'll handle it" and she DID. π«Ά no manual cleanup, no leaks, no stressed vibes.
β SEE ALSO β
okay this list is LONG and honestly iconic, she's a social butterfly. all of these are (9) pages, and they all live in the kernel file ./drivers/mux/core.c:
struct mux_state(9)struct devm_mux_state_state(9)mux_chip_alloc(9)mux_chip_register(9)mux_chip_unregister(9)mux_chip_free(9)devm_mux_chip_alloc(9)devm_mux_chip_register(9)mux_control_states(9)mux_control_select_delay(9)mux_state_select_delay(9)mux_control_try_select_delay(9)mux_state_try_select_delay(9)mux_control_deselect(9)mux_state_deselect(9)mux_get(9)mux_control_get(9)mux_control_get_optional(9)mux_control_put(9)devm_mux_control_get(9)mux_state_get(9)__devm_mux_state_get(9)devm_mux_state_get_from_np(9)devm_mux_state_get_optional(9)devm_mux_state_get_selected(9)
like i said. A LOT of friends. iykyk π
reminder bestie: this is kernel API, so keep those names and signatures exactly as they are. no renaming, no "improving", no inventing extra behavior. the vibes are mine, the facts are not. π
β¨ slay, that's the page β¨ source file ./drivers/mux, dated October 2026, and that's on periodt. ππ
π¦ 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