devm_regmap_init_mdio(9)
π devm_regmap_init_mdio(9) β the managed-regmap glow-up, MDIO edition π
okay so bestie, welcome to devm_regmap_init_mdio from the Kernel API Manual β¨ this is the one that sets you up with a register map over MDIO and handles the cleanup for you, because we do not do manual regmap_exit in this house π
β¨ SYNOPSIS β¨
devm_regmap_init_mdio (mdio_dev , config );
πΈ ARGUMENTS πΈ
mdio_devβ the device you're gonna be interacting with π«Ά like, that's your buddy for the whole operationconfigβ the configuration for the register map π everything it needs to know about how you want it set up
π DESCRIPTION π
so what do you even get back? the return value is gonna be an ERR_PTR on error π or, if the vibes are correct, a valid pointer to a struct regmap π and here's the iconic part: that regmap gets automatically freed by the device management code β¨ not you. never you. the managed-devm machinery is the main character here and she's got it fr fr π
lowkey the whole point: you get the register map, you forget about it, device management handles the goodbye π¦
π SEE ALSO π
Kernel file ./include/linux/regmap.h β and here's the whole friend group, no cap, every single one:
struct reg_default(9)struct reg_sequence(9)regmap_read_poll_timeout(9)regmap_read_poll_timeout_atomic(9)regmap_field_read_poll_timeout(9)struct regmap_range(9)struct regmap_access_table(9)struct regmap_config(9)struct regmap_range_cfg(9)struct regmap_sdw_mbq_cfg(9)struct regmap_bus(9)regmap_init(9)regmap_init_i2c(9)regmap_init_mdio(9)regmap_init_sccb(9)regmap_init_slimbus(9)regmap_init_spi(9)regmap_init_spmi_base(9)regmap_init_spmi_ext(9)regmap_init_w1(9)regmap_init_mmio_clk(9)regmap_init_mmio(9)regmap_init_ac97(9)regmap_init_sdw(9)regmap_init_sdw_mbq(9)regmap_init_sdw_mbq_cfg(9)regmap_init_i3c(9)regmap_init_spi_avmm(9)regmap_init_fsi(9)devm_regmap_init(9)devm_regmap_init_i2c(9)devm_regmap_init_sccb(9)devm_regmap_init_spi(9)devm_regmap_init_spmi_base(9)devm_regmap_init_spmi_ext(9)devm_regmap_init_w1(9)devm_regmap_init_mmio_clk(9)devm_regmap_init_mmio(9)devm_regmap_init_ac97(9)devm_regmap_init_sdw(9)devm_regmap_init_sdw_mbq(9)devm_regmap_init_sdw_mbq_cfg(9)devm_regmap_init_slimbus(9)devm_regmap_init_i3c(9)devm_regmap_init_spi_avmm(9)devm_regmap_init_fsi(9)struct reg_field(9)struct regmap_irq_type(9)struct regmap_irq(9)struct regmap_irq_chip(9)
and that's the whole page, bestie π this lil drop of documentation lives in ./include/linux, dated October 2026, and it's filed under devm_regmap_init_mdio(9) π go forth and init some managed register maps, you absolute icon π§
π¦ 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