]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
thermal/drivers/hisi: Simplify with dev_err_probe()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 9 Jul 2024 12:59:36 +0000 (14:59 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 15 Jul 2024 11:31:40 +0000 (13:31 +0200)
Error handling in probe() can be a bit simpler with dev_err_probe().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-6-241644e2b6e0@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/hisi_thermal.c

index dd751ae63608ed77c24962a15cc183d0f0b289a3..0eb657db62e42b706385a94fc8af07b54efc1d30 100644 (file)
@@ -388,15 +388,10 @@ static int hi6220_thermal_probe(struct hisi_thermal_data *data)
 {
        struct platform_device *pdev = data->pdev;
        struct device *dev = &pdev->dev;
-       int ret;
 
        data->clk = devm_clk_get(dev, "thermal_clk");
-       if (IS_ERR(data->clk)) {
-               ret = PTR_ERR(data->clk);
-               if (ret != -EPROBE_DEFER)
-                       dev_err(dev, "failed to get thermal clk: %d\n", ret);
-               return ret;
-       }
+       if (IS_ERR(data->clk))
+               return dev_err_probe(dev, PTR_ERR(data->clk), "failed to get thermal clk\n");
 
        data->sensor = devm_kzalloc(dev, sizeof(*data->sensor), GFP_KERNEL);
        if (!data->sensor)