summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/imx_thermal.c
diff options
context:
space:
mode:
authorAnson Huang <anson.huang@nxp.com>2018-11-21 06:49:40 +0100
committerEduardo Valentin <edubezval@gmail.com>2019-01-02 13:47:12 +0100
commit925b38361852ef314e9ecc649e830ad5319e3a65 (patch)
treeda41bbc5d81b74e6b71f5fde4954ad1930b88cdc /drivers/thermal/imx_thermal.c
parentthermal: imx: fix for dependency on cpu-freq (diff)
downloadlinux-925b38361852ef314e9ecc649e830ad5319e3a65.tar.xz
linux-925b38361852ef314e9ecc649e830ad5319e3a65.zip
thermal: imx: save one condition block for normal case of nvmem initialization
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>
Diffstat (limited to 'drivers/thermal/imx_thermal.c')
-rw-r--r--drivers/thermal/imx_thermal.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index c924396685a0..bb6754a5342c 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -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;