thermal: spear13xx: checking for NULL instead of IS_ERR()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Mar 2012 19:55:04 +0000 (12:55 -0700)
committerLen Brown <len.brown@intel.com>
Thu, 22 Mar 2012 05:07:22 +0000 (01:07 -0400)
thermal_zone_device_register() never returns NULL, on error it returns and
ERR_PTR().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Viresh Kumar <viresh.kumar@st.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@st.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/thermal/spear_thermal.c

index be94413b95a3c75040935fc20bd4388b98ff1b56..c2e32df3b164e852137a2c720578899ac8f46b22 100644 (file)
@@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
 
        spear_thermal = thermal_zone_device_register("spear_thermal", 0,
                                stdev, &ops, 0, 0, 0, 0);
-       if (!spear_thermal) {
+       if (IS_ERR(spear_thermal)) {
                dev_err(&pdev->dev, "thermal zone device is NULL\n");
-               ret = -EINVAL;
+               ret = PTR_ERR(spear_thermal);
                goto disable_clk;
        }