]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: most: dim2: use dev_err_probe and proper error codes for clock
authorArtem Lytkin <iprintercanon@gmail.com>
Tue, 24 Feb 2026 18:07:49 +0000 (21:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Feb 2026 15:03:40 +0000 (07:03 -0800)
Replace hardcoded -EFAULT returns with dev_err_probe() and PTR_ERR()
when devm_clk_get() fails in fsl_mx6_enable(). This ensures the
correct error code is propagated (e.g. -EPROBE_DEFER for deferred
probing) and avoids log noise during probe deferral.

Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
Link: https://patch.msgid.link/20260224180750.28468-3-iprintercanon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/dim2/dim2.c

index cea1ba99caf796414f4f5c0948f4e04a66b4b351..e4c8b4995c6114b816aa36e8dabc46eabe16d36c 100644 (file)
@@ -921,10 +921,9 @@ static int fsl_mx6_enable(struct platform_device *pdev)
        int ret;
 
        dev->clk = devm_clk_get(&pdev->dev, "mlb");
-       if (IS_ERR(dev->clk)) {
-               dev_err(&pdev->dev, "unable to get mlb clock\n");
-               return -EFAULT;
-       }
+       if (IS_ERR(dev->clk))
+               return dev_err_probe(&pdev->dev, PTR_ERR(dev->clk),
+                                    "unable to get mlb clock\n");
 
        ret = clk_prepare_enable(dev->clk);
        if (ret) {
@@ -936,9 +935,9 @@ static int fsl_mx6_enable(struct platform_device *pdev)
                /* enable pll */
                dev->clk_pll = devm_clk_get(&pdev->dev, "pll8_mlb");
                if (IS_ERR(dev->clk_pll)) {
-                       dev_err(&pdev->dev, "unable to get mlb pll clock\n");
                        clk_disable_unprepare(dev->clk);
-                       return -EFAULT;
+                       return dev_err_probe(&pdev->dev, PTR_ERR(dev->clk_pll),
+                                            "unable to get mlb pll clock\n");
                }
 
                writel(0x888, dev->io_base + 0x38);