thermal: spear13xx: checking for NULL instead of IS_ERR()
Subsystems (2)
PATCH 1/1 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 <[email protected]>
drivers/thermal/spear_thermal.c +2 -2
@@ -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; }
Quoted 11 lines · Dan Carpenter
thermal_zone_device_register()never returns NULL, on error it returns andERR_PTR().Signed-off-by Dan Carpenter <[email protected]>drivers/thermal/spear_thermal.c +0
-0@@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
drivers/thermal/spear_thermal.c static int spear_thermal_probe(struct platform_device *pdev) · line 157
Quoted 10 lines
drivers/thermal/spear_thermal.c +2
-2spear_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; }
Thanks.
Reviewed-by Viresh Kumar <[email protected]>
Signature · 1 line
viresh
Thanks Dan.
Il 29/02/2012 07:31, Dan Carpenter ha scritto:
Quoted 11 lines
thermal_zone_device_register()never returns NULL, on error it returns andERR_PTR().Signed-off-by Dan Carpenter <[email protected]>drivers/thermal/spear_thermal.c +0
-0@@ -149,9 +149,9 @@ static int spear_thermal_probe(struct platform_device *pdev)
drivers/thermal/spear_thermal.c static int spear_thermal_probe(struct platform_device *pdev) · line 157
Quoted 10 lines
drivers/thermal/spear_thermal.c +2
-2spear_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; }
Reviewed-by Vincenzo Frascino <[email protected]>