stm_find_device(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… stm_find_device(9) β€” like, the Kernel API Manual page you didn't know you needed πŸŽ€

okay so bestie, welcome to the glow-up of stm_find_device β€” it's a kernel API manual situation, and honestly? iconic. let's get into it ✨


🌸 NAME 🌸

stm_find_device β€” finds an stm device by name, no cap πŸ”


πŸ¦‹ SYNOPSIS πŸ¦‹

struct stm_device * stm_find_device (const char *buf );

πŸ’– ARGUMENTS πŸ’–

  • buf β€” a character buffer holding the name you're hunting for. literally just the name, sitting in a buffer, being a vibe 🫢

✨ DESCRIPTION ✨

so when does this even get called? two whole situations, bestie:

  • when a policy gets assigned to an stm device, or
  • when an stm_source device gets linked to an stm device 😌

and what does it do? it grabs the device's reference (that's get_device) and the module reference. both of them. and here's the part where you gotta pay attention, because the calling path needs to make sure to drop them with stm_put_device. don't leave them hanging, that's not the move πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

an stm device pointer β€” or null if the lookup failed πŸ’€ (as in, nothing found, that's a null, go home)


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/hwtracing/stm/core.c, plus the whole friend group:


🧚 sign-off 🧚

and that's the page!! brought to you from ./drivers/hwtracing/stm, dated October 2026 ⭐ she's giving kernel documentation but make it cute. mwah πŸ’…πŸ’œ

πŸ“¦ where this page comes from