mux_state_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mux_state_get β€” from the Kernel API Manual ✨

okay bestie, gather round, because this one is a lookup function and she is lowkey the main character of the mux subsystem. mux_state_get is literally the function that goes "hey, does this device have a mux-state? and if so, can I have it?" πŸŽ€


✨ NAME ✨

mux_state_get β€” Get the mux-state for a device. 🫢 that's it, that's the whole vibe.


🌸 SYNOPSIS 🌸

struct mux_state * mux_state_get (struct device *dev , const char
*mux_name , bool optional , struct device_node *np );

no cap, that's the exact signature, don't @ me, I copied it character for character πŸ’…


πŸ’– ARGUMENTS πŸ’–

  • dev β€” The device that needs a mux-state. your little guy. the one who's asking. πŸ‘‘
  • mux_name β€” The name identifying the mux-state. like a name tag at a party, but for muxes. 🏷️
  • optional β€” Whether to return NULL and silence errors when mux doesn't exist. so if it's set and the mux is a no-show, you get a chill NULL instead of a whole dramatic error situation. 😌
  • np β€” the device nodes, use dev->of_node if it is NULL. that's the fallback, that's the default, that's the move. πŸ¦‹

⭐ RETURN ⭐

  • Pointer to the mux-state on success πŸŽ‰ β€” you ate, congrats
  • an ERR_PTR with a negative errno on error 😭 β€” check it with IS_ERR()-energy, don't just raw-dog the pointer
  • or NULL if optional is true and mux doesn't exist πŸ™ˆ β€” no drama, no error, just a gentle nothing
like yes queen, three whole outcomes, so please actually check what you got back before you dereference it. fr fr. πŸ’€

🌈 SEE ALSO 🌈

the source of truth lives in the Kernel file ./drivers/mux/core.c β€” go read her, she's iconic. and then the whole extended friend group:

like, that's a whole group chat and every single one of them is in it. iykyk πŸ’œ


okay that's the page!! sourced straight from ./drivers/mux, dated October 2026, and brought to you by the Kernel API Manual. mwah πŸ’‹ slay, go get your mux-state, and remember: check your return values bestie 🧚✨

πŸ“¦ where this page comes from