Skip to content

Commit

Permalink
thermal: rcar_thermal: propagate return value of thermal_zone_device_…
Browse files Browse the repository at this point in the history
…register

thermal_zone_device_register returns a value contained in the pointer itself
use PTR_ERR to obtain the address and return it at the end.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Devendra Naga authored and Zhang Rui committed Mar 11, 2013
1 parent aa3b5d2 commit fb84d99
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/thermal/rcar_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
struct resource *res, *irq;
int mres = 0;
int i;
int ret = -ENODEV;
int idle = IDLE_INTERVAL;

common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL);
Expand Down Expand Up @@ -438,6 +439,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
idle);
if (IS_ERR(priv->zone)) {
dev_err(dev, "can't register thermal zone\n");
ret = PTR_ERR(priv->zone);
goto error_unregister;
}

Expand All @@ -457,7 +459,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
rcar_thermal_for_each_priv(priv, common)
thermal_zone_device_unregister(priv->zone);

return -ENODEV;
return ret;
}

static int rcar_thermal_remove(struct platform_device *pdev)
Expand Down

0 comments on commit fb84d99

Please sign in to comment.