devm_cpm_muram_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_cpm_muram_alloc(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: you're poking around in kernel-land and you need some muram. this is the page for that. periodt. ✨


✨ NAME ✨

devm_cpm_muram_alloc β€” literally the resource-managed version of cpm_muram_alloc, and yes that's the whole vibe 🫢


🌸 SYNOPSIS 🌸

s32 devm_cpm_muram_alloc (struct device *dev , unsigned long size ,
       unsigned long align );

look at her. three params, one s32 return, zero notes. iconic. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the Device you're allocating memory for 🫢 (yes, the struct itself, not a copy, not a vibe)
  • size β€” number of bytes to allocate. the amount. the quantity. the size, bestie πŸ’–
  • align β€” the requested alignment, in bytes. alignment matters, ngl 🎯

πŸ’œ DESCRIPTION πŸ’œ

So this function hands you back a non-negative offset into the muram area, or a negative errno on failure β€” exactly like cpm_muram_alloc does. fr fr. 😭 That's the deal.

When you've got your offset and you want the actual virtual address of that area? That's when you call cpm_muram_addr. she's the one who knows where things live πŸ’…

Now here's the part where this one is different, and it's giving main character energy: compare it against plain cpm_muram_alloc, because the memory allocated by this resource-managed version is automatically freed on driver detach. 🧚✨

🚨 which means β€” say it with me β€” cpm_muram_free must NOT be called to release the allocated memory. not ever. do not do it. the devm machinery has it handled, and if you double-free it that's on you bestie πŸ’€

🌈 SEE ALSO 🌈


and that's the whole page, no cap πŸ“ this gem lives over in ./drivers/soc/fsl/qe and got stamped October 2026 β€” so like, go forth and allocate responsibly, and remember: devm frees it for you, you just look pretty πŸ’–πŸ’…πŸŒŸ

πŸ“¦ where this page comes from