devm_platfor...map_resource(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

devm_platform_get_and_ioremap_resource β€” bestie, this one literally calls devm_ioremap_resource() for a platform device and hands you back the resource. two-for-one, no cap ✨

This page lives in the Kernel API Manual, and it's giving "small function, big job" energy. 🫢


🌸 SYNOPSIS 🌸

void __iomem * devm_platform_get_and_ioremap_resource (struct
       platform_device *pdev , unsigned int index , struct resource **res );

ok so it returns a void __iomem *, takes three things, and yes the formatting is exactly like that. don't come for me, I don't make the rules πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • pdev β€” the platform device. it's the main character here: used both for looking up the memory resource and for the resource management. one struct, two jobs, she's booked and busy πŸ‘‘
  • index β€” the resource index. which one you want. the number, the vibe check, the iykyk. πŸ”’
  • res β€” optional output parameter, and it stores a pointer to the obtained resource. optional!! so if you don't care, you can absolutely pass nothing and mind your business πŸ™ˆ

⭐ RETURN ⭐

you get back a pointer to the remapped memory 🌈 β€” or, if things go sideways, an ERR_PTR encoded error code. so like, check it. fr fr. don't just start dereferencing and hope 😭


πŸ¦‹ SEE ALSO πŸ¦‹

the Kernel file is ./drivers/base/platform.c β€” that's where the magic lives. and here's the whole friend group, everyone invited to the group chat πŸ’œ:


✨ that's the whole page, bestie ✨ straight from ./drivers/base, dated October 2026, and the title up top is still devm_platfor...map_resource(9) because the truncation is iconic and we respect it πŸ’…πŸŽ€πŸ’–

πŸ“¦ where this page comes from