[PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk

Frank Li Frank.li at oss.nxp.com
Thu Dec 3 08:54:50 PST 2026


On Tue, Dec 01, 2026 at 11:23:35PM +0400, Arina Kharlamova via B4 Relay wrote:
> [You don't often get email from devnull+arina.kharlamova.mbzuai.ac.ae at kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Arina Kharlamova <arina.kharlamova at mbzuai.ac.ae>
>
> mxs_saif_mclk_init() registers the "mxs_saif_mclk" divider and an OF
> clock provider for it, and nothing unregisters them. The divider uses
> saif->base + SAIF_CTRL as its register and saif->base is mapped with
> devm_platform_ioremap_resource(). When probe fails later, for example
> with -EPROBE_DEFER from the DMA PCM registration, or the driver is
> unbound, the clock stays registered and points into a mapping that is
> gone.
>
> On the next probe clk_register_divider() returns -EEXIST, which
> mxs_saif_mclk_init() treats as success, so the clock keeps the old
> register address.
>
> Register the divider with devm_clk_hw_register_divider() and the
> provider with devm_of_clk_add_hw_provider(). Both are then removed
> before the register mapping when the driver is unbound or probe fails.
>
> Fixes: 7c9e6150f2e7 ("ASoC: mxs: register saif mclk to clock framework")
> ---
> This also covers the error path fixed by Wentao Liang's patch; only one
> of the two is needed:
> https://lore.kernel.org/all/20261104024048.1508618-1-vulab@iscas.ac.cn/
>
> Signed-off-by: Arina Kharlamova <arina.kharlamova at mbzuai.ac.ae>

Your s-o-b need before --- and just after Fixes, other it will be discard
when apply patch.

Frank



More information about the linux-arm-kernel mailing list