aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/rcar_thermal.c
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2013-03-04 11:52:47 -0500
committerZhang Rui <rui.zhang@intel.com>2013-03-11 11:09:24 -0400
commitfb84d9907f0ff0e3f7d70d55039ddf0f78d2a472 (patch)
treeae2bac5cb75616afe177950c0e5cb19533612085 /drivers/thermal/rcar_thermal.c
parentaa3b5d222da5922ab1883eba3e9d8f92ad148155 (diff)
thermal: rcar_thermal: propagate return value of thermal_zone_device_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>
Diffstat (limited to 'drivers/thermal/rcar_thermal.c')
-rw-r--r--drivers/thermal/rcar_thermal.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index ab518140207d..2cc5b6115e3e 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -364,6 +364,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
364 struct resource *res, *irq; 364 struct resource *res, *irq;
365 int mres = 0; 365 int mres = 0;
366 int i; 366 int i;
367 int ret = -ENODEV;
367 int idle = IDLE_INTERVAL; 368 int idle = IDLE_INTERVAL;
368 369
369 common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL); 370 common = devm_kzalloc(dev, sizeof(*common), GFP_KERNEL);
@@ -438,6 +439,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
438 idle); 439 idle);
439 if (IS_ERR(priv->zone)) { 440 if (IS_ERR(priv->zone)) {
440 dev_err(dev, "can't register thermal zone\n"); 441 dev_err(dev, "can't register thermal zone\n");
442 ret = PTR_ERR(priv->zone);
441 goto error_unregister; 443 goto error_unregister;
442 } 444 }
443 445
@@ -457,7 +459,7 @@ error_unregister:
457 rcar_thermal_for_each_priv(priv, common) 459 rcar_thermal_for_each_priv(priv, common)
458 thermal_zone_device_unregister(priv->zone); 460 thermal_zone_device_unregister(priv->zone);
459 461
460 return -ENODEV; 462 return ret;
461} 463}
462 464
463static int rcar_thermal_remove(struct platform_device *pdev) 465static int rcar_thermal_remove(struct platform_device *pdev)