Skip to content

Commit

Permalink
thermal: db8500: Fix checking return value of thermal_zone_device_reg…
Browse files Browse the repository at this point in the history
…ister

thermal_zone_device_register() returns ERR_PTR on error, thus use
IS_ERR rather than IS_ERR_OR_NULL to check return value.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Axel Lin authored and Zhang Rui committed Mar 26, 2013
1 parent bde0066 commit f534e9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/db8500_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static int db8500_thermal_probe(struct platform_device *pdev)
pzone->therm_dev = thermal_zone_device_register("db8500_thermal_zone",
ptrips->num_trips, 0, pzone, &thdev_ops, NULL, 0, 0);

if (IS_ERR_OR_NULL(pzone->therm_dev)) {
if (IS_ERR(pzone->therm_dev)) {
dev_err(&pdev->dev, "Register thermal zone device failed.\n");
return PTR_ERR(pzone->therm_dev);
}
Expand Down

0 comments on commit f534e9b

Please sign in to comment.