]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: sun4i-spdif: Add missing check for devm_regmap_init_mmio
authorChen Ni <nichen@iscas.ac.cn>
Tue, 27 Jan 2026 03:40:25 +0000 (11:40 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 27 Jan 2026 12:46:03 +0000 (12:46 +0000)
Add check for the return value of devm_regmap_init_mmio() and return the
error if it fails in order to catch the error.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Link: https://patch.msgid.link/20260127034025.2044669-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun4i-spdif.c

index 1e755a716c632dde9ef8c9c3842ed6e09e7eaadb..65de03ca3ad2910642671374f92e923ae2530312 100644 (file)
@@ -684,6 +684,10 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
 
        host->regmap = devm_regmap_init_mmio(&pdev->dev, base,
                                                &sun4i_spdif_regmap_config);
+       if (IS_ERR(host->regmap)) {
+               dev_err(&pdev->dev, "failed to initialise regmap.\n");
+               return PTR_ERR(host->regmap);
+       }
 
        /* Clocks */
        host->apb_clk = devm_clk_get(&pdev->dev, "apb");