devm_ioport_map(9)
π devm_ioport_map β the kernel API manual, bestie edition π
okay so real talk, this page lives in the Kernel API Manual and it's about devm_ioport_map(9) β like, that's literally the whole title. Let's get into it π
β¨ NAME β¨
devm_ioport_map β Managed ioport_map(). that's it, that's the name, and yes the "managed" part is doing a LOT of heavy lifting here (you'll see why, keep reading π)
πΈ SYNOPSIS πΈ
void __iomem * devm_ioport_map (struct device *dev , unsigned long port
, unsigned int nr );
look at her. three params, returns a void __iomem *. no cap, she's giving very much "I map ports and I handle my own cleanup" energy π
π¦ ARGUMENTS π¦
devβ the generic device you're mapping the ioport for. like, this is the device that's gonna own this mapping, bestie, so be nice to it π«Άportβ the port to map. the actual port. the one you want β¨nrβ number of ports to map. so it's not just one lil port, you can grab a whole little squad of them π
β DESCRIPTION β
Managed ioport_map(). periodt.
the whole vibe here is: this is the managed version, which means the mapping is automatically unmapped on driver detach. you don't have to remember to clean up. the kernel does it for you. that's the entire personality of the devm_ prefix and honestly? iconic. main character energy π§
no manual ioport_unmap() choreography needed on your part β when the driver detaches, the mapping goes poof π¨
π₯ RETURN π₯
- a pointer to the remapped memory β¨
- or
NULLon failure π (always check, bestie, always check β that's the vibe check)
π SEE ALSO π
Kernel file ./lib/devres.c and her whole friend group:
devm_ioremap(9)devm_ioremap_uc(9)devm_ioremap_wc(9)devm_iounmap(9)devm_ioremap_resource(9)devm_ioremap_resource_wc(9)devm_ioport_unmap(9)devm_arch_phys_wc_add(9)devm_arch_io_reserve_memtype_wc(9)
like, that's a whole ensemble cast and they all ate ππ
and that's the page, bestie!! β¨π
this lil masterpiece comes to you from ./lib, dated October 2026, and it's filed under devm_ioport_map(9) β so if you ever need to find her again, that's where she lives ππ·π
π¦ 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