dev_get_regmap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dev_get_regmap β€” the manual page for dev_get_regmap(9), bestie edition

okay so this is a Kernel API Manual page, and it's literally about going and grabbing the regmap for a device. that's it. that's the whole vibe. let's get into it ✨


✨ NAME ✨

dev_get_regmap β€” obtain the regmap (if any) for a device πŸŽ€


🌸 SYNOPSIS 🌸

struct regmap * dev_get_regmap (struct device *dev , const char *name );

like... look at that signature. she's serving pointers. struct regmap * coming back at you, taking a struct device *dev and a const char *name. iconic. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device you wanna retrieve the map for. your main character device, basically. πŸ‘‘
  • name β€” optional name for the register map, and usually it's NULL. yeah, most of the time you just leave it NULL and let the kernel do its thing. πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

so what does it actually do?? it returns the regmap for the device if one is present, or NULL. no cap, that's the whole thing.

now about that name, because this is the part where people get it wrong:

  • if name is specified, then it must match the name that was specified when registering the device. like, it has to be the exact same name. no vibe-matching, no "close enough" β€” it's a match or it's nothing. ⭐
  • if name is NULL, then the first regmap found will be used. first come, first served, slay. πŸ’…
devices with multiple register maps are very rare, and generic code should normally not need to specify a name. so like... if you're out here passing a name in generic code, bestie, why. 🫢

πŸ”₯ SEE ALSO πŸ”₯

the kernel file lives at ./drivers/base/regmap/regmap.c β€” and here's the whole friend group, fr fr:

like, that's the whole regmap extended universe. go read them. iykyk 🧚


and that's the page!! this lil gem comes from ./drivers/base/regmap, dated October 2026, and it's filed under dev_get_regmap(9). mwah, no notes, go get your regmap bestie πŸ’œβœ¨

πŸ“¦ where this page comes from