]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: rockchip: spdif: Use dev_err_probe
authorSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 3 Feb 2026 16:46:26 +0000 (17:46 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 5 Feb 2026 18:46:43 +0000 (18:46 +0000)
Cleanup the probe routine a little bit by using dev_err_probe
instead of dev_err.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://patch.msgid.link/20260203-rockchip-spdif-cleanup-and-bsp-sync-v2-4-4412016cf577@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_spdif.c

index 841ef499ed7fcffd0c367ce1452feec90b19a067..1c62fcb0d8d4769e76f48e99ce27e0e55a578f54 100644 (file)
@@ -279,11 +279,9 @@ static int rk_spdif_probe(struct platform_device *pdev)
                struct regmap *grf;
 
                grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
-               if (IS_ERR(grf)) {
-                       dev_err(&pdev->dev,
+               if (IS_ERR(grf))
+                       return dev_err_probe(&pdev->dev, PTR_ERR(grf),
                                "rockchip_spdif missing 'rockchip,grf'\n");
-                       return PTR_ERR(grf);
-               }
 
                /* Select the 8 channel SPDIF solution on RK3288 as
                 * the 2 channel one does not appear to work
@@ -334,16 +332,12 @@ static int rk_spdif_probe(struct platform_device *pdev)
        ret = devm_snd_soc_register_component(&pdev->dev,
                                              &rk_spdif_component,
                                              &rk_spdif_dai, 1);
-       if (ret) {
-               dev_err(&pdev->dev, "Could not register DAI\n");
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(&pdev->dev, ret, "Could not register DAI\n");
 
        ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
-       if (ret) {
-               dev_err(&pdev->dev, "Could not register PCM\n");
-               return ret;
-       }
+       if (ret)
+               return dev_err_probe(&pdev->dev, ret, "Could not register PCM\n");
 
        return 0;
 }