thermal: add thermal meson cooldev point check
authorHuan Biao <huan.biao@amlogic.com>
Thu, 2 Aug 2018 07:07:46 +0000 (15:07 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 3 Aug 2018 05:38:25 +0000 (22:38 -0700)
PD#170391: thermal: add thermal meson cooldev point check.

Change-Id: I9aa705a764399670583cb51e0dc8b743ec80fd54
Signed-off-by: Huan Biao <huan.biao@amlogic.com>
drivers/amlogic/thermal/meson_cooldev.c

index dba7321..c93b207 100644 (file)
@@ -212,13 +212,13 @@ int meson_cooldev_min_update(struct platform_device *pdev, int index)
        int ret;
        int cpu, c_id;
 
-       cool = get_cool_dev_by_node(pdev, cdev->np);
-       if (!cool)
-               return -ENODEV;
 
        if (!cdev)
                return -ENODEV;
 
+       cool = get_cool_dev_by_node(pdev, cdev->np);
+       if (!cool)
+               return -ENODEV;
        if (cool->min_state == 0)
                return 0;