Thermal: rcar: Convert to devm_ioremap_resource()
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>
This commit is contained in:
parent
6bc51b6622
commit
5095526faf
1 changed files with 6 additions and 10 deletions
|
@ -400,11 +400,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
|
||||||
/*
|
/*
|
||||||
* rcar_has_irq_support() will be enabled
|
* rcar_has_irq_support() will be enabled
|
||||||
*/
|
*/
|
||||||
common->base = devm_request_and_ioremap(dev, res);
|
common->base = devm_ioremap_resource(dev, res);
|
||||||
if (!common->base) {
|
if (IS_ERR(common->base))
|
||||||
dev_err(dev, "Unable to ioremap thermal register\n");
|
return PTR_ERR(common->base);
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* enable temperature comparation */
|
/* enable temperature comparation */
|
||||||
rcar_thermal_common_write(common, ENR, 0x00030303);
|
rcar_thermal_common_write(common, ENR, 0x00030303);
|
||||||
|
@ -423,11 +421,9 @@ static int rcar_thermal_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->base = devm_request_and_ioremap(dev, res);
|
priv->base = devm_ioremap_resource(dev, res);
|
||||||
if (!priv->base) {
|
if (IS_ERR(priv->base))
|
||||||
dev_err(dev, "Unable to ioremap priv register\n");
|
return PTR_ERR(priv->base);
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
priv->common = common;
|
priv->common = common;
|
||||||
priv->id = i;
|
priv->id = i;
|
||||||
|
|
Loading…
Add table
Reference in a new issue