of_machine_read_compatible(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’» of_machine_read_compatible β€” the "who even IS this machine" function ✨

okay so this one lives in the Kernel API Manual (section 9, the kernel-API girlies πŸŽ€), and it's literally your go-to for grabbing the compatible string of this machine. that's it. that's the vibe. iykyk πŸ’…


🌸 NAME 🌸

of_machine_read_compatible β€” Get the compatible string of this machine

(no cap, that's the whole pitch 🫢)


✨ SYNOPSIS ✨

int of_machine_read_compatible (const char **compatible , unsigned int
index );

look at her. two params, one int coming back at you. so clean. so iconic. πŸ‘‘


🧚 ARGUMENTS 🧚

  • compatible β€” this is the address at which the address of the compatible string will be stored. yes bestie, address of an address β€” it's pointer-to-a-pointer realness πŸ’€ you hand it a spot, it drops the address of the compatible string in there.
  • index β€” the index of the compatible entry in the list. like, which one do you want? there's a list, you pick a slot. literally that simple πŸ“

⭐ RETURN ⭐

  • 0 on success πŸŽ‰
  • negative error number on failure 😭

that's it. zero means slay, negative means the machine said no πŸ™ˆ


πŸ”₯ SEE ALSO πŸ”₯

okay this is the part where the page just. keeps. going. and honestly? respect. she knows everyone. here's the whole group chat, and inside it is the kernel file ./drivers/of/base.c β€” that's where the magic lives, no cap:

forty-four entries. that's not a see-also, that's a whole friend group 🫢✨


πŸ’– quick vibe check: compatible has to be a place you can write to, because the function is storing the address of the compatible string there β€” not the string itself.

πŸŽ€ the cute little sign-off πŸŽ€

this page comes to you from ./drivers/of (the source), and it's dated October 2026 β€” so yeah, she's fresh, she's current, she's giving main character energy πŸŒˆπŸ‘‘ thanks for reading bestie, go read some device trees, mwah πŸ’‹

πŸ“¦ where this page comes from