devm_cpm_muram_alloc(9)
π 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 π
- Kernel file
./drivers/soc/fsl/qe/qe_common.cπ cpm_muram_free(9)devm_cpm_muram_alloc_fixed(9)cpm_muram_addr(9)cpm_muram_dma(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms