Skip to content

Commit

Permalink
Thermal: rcar: Convert to devm_ioremap_resource()
Browse files Browse the repository at this point in the history
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages; so all explicit
error messages can be removed from the failure code paths.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
  • Loading branch information
Sachin Kamat authored and Zhang Rui committed Mar 11, 2013
1 parent 6bc51b6 commit 5095526
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions drivers/thermal/rcar_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
/*
* rcar_has_irq_support() will be enabled
*/
common->base = devm_request_and_ioremap(dev, res);
if (!common->base) {
dev_err(dev, "Unable to ioremap thermal register\n");
return -ENOMEM;
}
common->base = devm_ioremap_resource(dev, res);
if (IS_ERR(common->base))
return PTR_ERR(common->base);

/* enable temperature comparation */
rcar_thermal_common_write(common, ENR, 0x00030303);
Expand All @@ -423,11 +421,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
return -ENOMEM;
}

priv->base = devm_request_and_ioremap(dev, res);
if (!priv->base) {
dev_err(dev, "Unable to ioremap priv register\n");
return -ENOMEM;
}
priv->base = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->base))
return PTR_ERR(priv->base);

priv->common = common;
priv->id = i;
Expand Down

0 comments on commit 5095526

Please sign in to comment.