linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource()
@ 2013-03-04  6:45 Sachin Kamat
  2013-03-04  6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Sachin Kamat @ 2013-03-04  6:45 UTC (permalink / raw)
  To: linux-pm; +Cc: rui.zhang, thierry.reding, sachin.kamat, Andrew Lunn

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: Andrew Lunn <andrew@lunn.ch>
---
 drivers/thermal/dove_thermal.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/thermal/dove_thermal.c b/drivers/thermal/dove_thermal.c
index 7b0bfa0..3078c40 100644
--- a/drivers/thermal/dove_thermal.c
+++ b/drivers/thermal/dove_thermal.c
@@ -143,22 +143,18 @@ static int dove_thermal_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	priv->sensor = devm_request_and_ioremap(&pdev->dev, res);
-	if (!priv->sensor) {
-		dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
-		return -EADDRNOTAVAIL;
-	}
+	priv->sensor = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(priv->sensor))
+		return PTR_ERR(priv->sensor);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 	if (!res) {
 		dev_err(&pdev->dev, "Failed to get platform resource\n");
 		return -ENODEV;
 	}
-	priv->control = devm_request_and_ioremap(&pdev->dev, res);
-	if (!priv->control) {
-		dev_err(&pdev->dev, "Failed to request_ioremap memory\n");
-		return -EADDRNOTAVAIL;
-	}
+	priv->control = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(priv->control))
+		return PTR_ERR(priv->control);
 
 	ret = dove_init_sensor(priv);
 	if (ret) {
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-11 14:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-04  6:45 [PATCH 1/3] Thermal: dove: Convert to devm_ioremap_resource() Sachin Kamat
2013-03-04  6:45 ` [PATCH 2/3] Thermal: rcar: " Sachin Kamat
2013-03-04  7:06   ` Thierry Reding
2013-03-11 14:35   ` Zhang Rui
2013-03-04  6:45 ` [PATCH 3/3] Thermal: kirkwood: " Sachin Kamat
2013-03-04  7:06   ` Thierry Reding
2013-03-04 20:16     ` Nobuhiro Iwamatsu
2013-03-11 14:35   ` Zhang Rui
2013-03-04  7:06 ` [PATCH 1/3] Thermal: dove: " Thierry Reding
2013-03-11 11:37   ` Sachin Kamat
2013-03-11 14:35 ` Zhang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).