devm_mux_state_get_optional(9)
π devm_mux_state_get_optional(9) β from the Kernel API Manual, bestie
okay so picture this: you're deep in the kernel, you need a mux-state for a device, but optional β like, only if it's actually there. That's literally this function. It's the resource-managed girlie of the mux-state-getting family, and she's iconic for it. π
β¨ SYNOPSIS β¨
struct mux_state * devm_mux_state_get_optional (struct device *dev ,
const char *mux_name );
like, that's the whole vibe. two args, one pointer back. slay. π
πΈ ARGUMENTS πΈ
devβ the device that needs a mux-state. she's the one asking, bestie. πmux_nameβ the name identifying the mux-state. think of it as the @ handle you're looking up. π
π RETURN π
so here's the vibe check on what you get back:
- Pointer to the mux-state on success π
- an
ERR_PTRwith a negativeerrnoon error π - or
NULLif mux doesn't exist π«₯
fr fr, clock that NULL case β it's optional, remember? absence isn't an error here, it's just, like, not present. iykyk.
π¦ DESCRIPTION π¦
The mux-state will automatically be freed on release. that's the whole point, bb β no manual cleanup era. devm handles it, you just live your life. β¨π§
π SEE ALSO π
Kernel file ./drivers/mux/core.c β plus the whole friend group, all of them, no cap:
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_selected(9)devm_mux_state_get_optional_selected(9)
and that's the post π this whole thing lives in ./drivers/mux, dated October 2026, and it's called devm_mux_state_get_optional(9) in case you forgot already π go forth and get those optional mux-states, bestie π«Άπ
π¦ 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