Browse Source

regulator: ti-abb: Convert to use devm_ioremap_resource

Commit 75096579c3ac ("lib: devres: Introduce devm_ioremap_resource()")
introduced devm_ioremap_resource() and deprecated the use of
devm_request_and_ioremap().

While at it, remove the error message as devm_ioremap_resource prints a similar
error message.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
Tushar Behera 12 years ago
parent
commit
d26ec830f5
1 changed files with 6 additions and 8 deletions
  1. 6 8
      drivers/regulator/ti-abb-regulator.c

+ 6 - 8
drivers/regulator/ti-abb-regulator.c

@@ -722,10 +722,9 @@ static int ti_abb_probe(struct platform_device *pdev)
 		ret = -ENODEV;
 		goto err;
 	}
-	abb->base = devm_request_and_ioremap(dev, res);
-	if (!abb->base) {
-		dev_err(dev, "Unable to map '%s'\n", pname);
-		ret = -ENOMEM;
+	abb->base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(abb->base)) {
+		ret = PTR_ERR(abb->base);
 		goto err;
 	}
 
@@ -776,10 +775,9 @@ static int ti_abb_probe(struct platform_device *pdev)
 		ret = -ENODEV;
 		goto skip_opt;
 	}
-	abb->ldo_base = devm_request_and_ioremap(dev, res);
-	if (!abb->ldo_base) {
-		dev_err(dev, "Unable to map '%s'\n", pname);
-		ret = -ENOMEM;
+	abb->ldo_base = devm_ioremap_resource(dev, res);
+	if (IS_ERR(abb->ldo_base)) {
+		ret = PTR_ERR(abb->ldo_base);
 		goto err;
 	}