]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: sunxi: sun50i-dmic: Add missing check for devm_regmap_init_mmio
authorChen Ni <nichen@iscas.ac.cn>
Tue, 27 Jan 2026 03:32:50 +0000 (11:32 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 27 Jan 2026 12:46:04 +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/20260127033250.2044608-1-nichen@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun50i-dmic.c

index bab1e29c99887c93e0086f97d19a896eb09e322e..eddfebe166169a1ceae82b59c05ae71a2c49c1c0 100644 (file)
@@ -358,6 +358,9 @@ static int sun50i_dmic_probe(struct platform_device *pdev)
 
        host->regmap = devm_regmap_init_mmio(&pdev->dev, base,
                                             &sun50i_dmic_regmap_config);
+       if (IS_ERR(host->regmap))
+               return dev_err_probe(&pdev->dev, PTR_ERR(host->regmap),
+                                    "failed to initialise regmap\n");
 
        /* Clocks */
        host->bus_clk = devm_clk_get(&pdev->dev, "bus");