ASoC: sun4i-spdif: Add missing check for devm_regmap_init_mmio
Commit Message
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>
---
sound/soc/sunxi/sun4i-spdif.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -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");