Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 374548
b: refs/heads/master
c: 1dc2082
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Zhang Rui committed Apr 2, 2013
1 parent b1bc229 commit 34666ed
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa0d654c84c7705d90a2492b4611e1da7ccdf69c
refs/heads/master: 1dc20828e674a781635286072bae909dc4e5c377
23 changes: 16 additions & 7 deletions trunk/drivers/thermal/rcar_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,15 @@ static int rcar_thermal_probe(struct platform_device *pdev)
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) {
dev_err(dev, "Could not allocate priv\n");
return -ENOMEM;
ret = -ENOMEM;
goto error_unregister;
}

priv->base = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);
if (IS_ERR(priv->base)) {
ret = PTR_ERR(priv->base);
goto error_unregister;
}

priv->common = common;
priv->id = i;
Expand All @@ -443,10 +446,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
goto error_unregister;
}

list_move_tail(&priv->list, &common->head);

if (rcar_has_irq_support(priv))
rcar_thermal_irq_enable(priv);

list_move_tail(&priv->list, &common->head);
}

platform_set_drvdata(pdev, common);
Expand All @@ -456,8 +459,11 @@ static int rcar_thermal_probe(struct platform_device *pdev)
return 0;

error_unregister:
rcar_thermal_for_each_priv(priv, common)
rcar_thermal_for_each_priv(priv, common) {
thermal_zone_device_unregister(priv->zone);
if (rcar_has_irq_support(priv))
rcar_thermal_irq_disable(priv);
}

return ret;
}
Expand All @@ -467,8 +473,11 @@ static int rcar_thermal_remove(struct platform_device *pdev)
struct rcar_thermal_common *common = platform_get_drvdata(pdev);
struct rcar_thermal_priv *priv;

rcar_thermal_for_each_priv(priv, common)
rcar_thermal_for_each_priv(priv, common) {
thermal_zone_device_unregister(priv->zone);
if (rcar_has_irq_support(priv))
rcar_thermal_irq_disable(priv);
}

platform_set_drvdata(pdev, NULL);

Expand Down

0 comments on commit 34666ed

Please sign in to comment.