Commit 6bc51b66 authored by Sachin Kamat's avatar Sachin Kamat Committed by Zhang Rui

Thermal: dove: 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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent f0e68fc3
...@@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev) ...@@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
priv->sensor = devm_request_and_ioremap(&pdev->dev, res); priv->sensor = devm_ioremap_resource(&pdev->dev, res);
if (!priv->sensor) { if (IS_ERR(priv->sensor))
dev_err(&pdev->dev, "Failed to request_ioremap memory\n"); return PTR_ERR(priv->sensor);
return -EADDRNOTAVAIL;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!res) { if (!res) {
dev_err(&pdev->dev, "Failed to get platform resource\n"); dev_err(&pdev->dev, "Failed to get platform resource\n");
return -ENODEV; return -ENODEV;
} }
priv->control = devm_request_and_ioremap(&pdev->dev, res); priv->control = devm_ioremap_resource(&pdev->dev, res);
if (!priv->control) { if (IS_ERR(priv->control))
dev_err(&pdev->dev, "Failed to request_ioremap memory\n"); return PTR_ERR(priv->control);
return -EADDRNOTAVAIL;
}
ret = dove_init_sensor(priv); ret = dove_init_sensor(priv);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment