]> Git Repo - linux.git/commitdiff
thermal: amlogic: Use dev_err_probe()
authorYe Xingchen <[email protected]>
Fri, 24 Mar 2023 02:20:11 +0000 (10:20 +0800)
committerDaniel Lezcano <[email protected]>
Fri, 7 Apr 2023 09:18:28 +0000 (11:18 +0200)
Replace the open-code with dev_err_probe() to simplify the code.

Signed-off-by: Ye Xingchen <[email protected]>
Reviewed-by: Neil Armstrong <[email protected]>
Reviewed-by: Martin Blumenstingl <[email protected]>
Signed-off-by: Daniel Lezcano <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/thermal/amlogic_thermal.c

index 4bf36386462f4e5e94c9aea5852b5f4cb1f98f95..3abc2dcef408a255a81efcf1b6179d77e3491d18 100644 (file)
@@ -262,11 +262,8 @@ static int amlogic_thermal_probe(struct platform_device *pdev)
                return PTR_ERR(pdata->regmap);
 
        pdata->clk = devm_clk_get(dev, NULL);
-       if (IS_ERR(pdata->clk)) {
-               if (PTR_ERR(pdata->clk) != -EPROBE_DEFER)
-                       dev_err(dev, "failed to get clock\n");
-               return PTR_ERR(pdata->clk);
-       }
+       if (IS_ERR(pdata->clk))
+               return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n");
 
        pdata->sec_ao_map = syscon_regmap_lookup_by_phandle
                (pdev->dev.of_node, "amlogic,ao-secure");
This page took 0.052165 seconds and 4 git commands to generate.