]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
thermal: imx: save one condition block for normal case of nvmem initialization
authorAnson Huang <anson.huang@nxp.com>
Wed, 21 Nov 2018 05:49:40 +0000 (05:49 +0000)
committerEduardo Valentin <edubezval@gmail.com>
Wed, 2 Jan 2019 12:47:12 +0000 (04:47 -0800)
Put return value checks of calling imx_init_from_nvmem_cells()
into one block to save one condition block for normal case.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/imx_thermal.c

index c924396685a0b39b16f30e724241b347715e573c..bb6754a5342c1520a4e3276dccf6aa9258c94423 100644 (file)
@@ -742,9 +742,10 @@ static int imx_thermal_probe(struct platform_device *pdev)
 
        if (of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) {
                ret = imx_init_from_nvmem_cells(pdev);
-               if (ret == -EPROBE_DEFER)
-                       return ret;
                if (ret) {
+                       if (ret == -EPROBE_DEFER)
+                               return ret;
+
                        dev_err(&pdev->dev, "failed to init from nvmem: %d\n",
                                ret);
                        return ret;