Skip to content

Commit

Permalink
thermal: spear13xx: checking for NULL instead of IS_ERR()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Len Brown committed Mar 22, 2012
1 parent de716e3 commit 03ee62f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thermal/spear_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 03ee62f

Please sign in to comment.