From: Dan Carpenter Date: Wed, 21 Mar 2012 19:55:04 +0000 (-0700) Subject: thermal: spear13xx: checking for NULL instead of IS_ERR() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03ee62f0b9919535a1be02f72fe8153255a7fda0;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git thermal: spear13xx: checking for NULL instead of IS_ERR() thermal_zone_device_register() never returns NULL, on error it returns and ERR_PTR(). Signed-off-by: Dan Carpenter Reviewed-by: Viresh Kumar Reviewed-by: Vincenzo Frascino Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c index be94413b95a3..c2e32df3b164 100644 --- a/drivers/thermal/spear_thermal.c +++ b/drivers/thermal/spear_thermal.c @@ -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; }