diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2013-08-19 04:51:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-08-22 06:15:00 -0400 |
commit | cf06cbb9a08d70e4a69f0ce7962df6bcf7405eae (patch) | |
tree | b55a733f297a4ba03c0277add452a63b94805d8e /drivers/regulator/ti-abb-regulator.c | |
parent | b36f4be3de1b123d8601de062e7dbfc904f305fb (diff) |
regulator: ti-abb: simplify platform_get_resource_byname/devm_ioremap_resource
Remove unneeded error handling on the result of a call to
platform_get_resource_byname when the value is passed to devm_ioremap_resource.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@@
expression pdev,res,e,e1;
expression ret != 0;
identifier l;
@@
res = platform_get_resource_byname(...);
- if (res == NULL) { ... \(goto l;\|return ret;\) }
e = devm_ioremap_resource(e1, res);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/ti-abb-regulator.c')
-rw-r--r-- | drivers/regulator/ti-abb-regulator.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/regulator/ti-abb-regulator.c b/drivers/regulator/ti-abb-regulator.c index 3753ed05e719..d8e3e1262bc2 100644 --- a/drivers/regulator/ti-abb-regulator.c +++ b/drivers/regulator/ti-abb-regulator.c | |||
@@ -717,11 +717,6 @@ static int ti_abb_probe(struct platform_device *pdev) | |||
717 | /* Map ABB resources */ | 717 | /* Map ABB resources */ |
718 | pname = "base-address"; | 718 | pname = "base-address"; |
719 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname); | 719 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname); |
720 | if (!res) { | ||
721 | dev_err(dev, "Missing '%s' IO resource\n", pname); | ||
722 | ret = -ENODEV; | ||
723 | goto err; | ||
724 | } | ||
725 | abb->base = devm_ioremap_resource(dev, res); | 720 | abb->base = devm_ioremap_resource(dev, res); |
726 | if (IS_ERR(abb->base)) { | 721 | if (IS_ERR(abb->base)) { |
727 | ret = PTR_ERR(abb->base); | 722 | ret = PTR_ERR(abb->base); |
@@ -770,11 +765,6 @@ static int ti_abb_probe(struct platform_device *pdev) | |||
770 | 765 | ||
771 | pname = "ldo-address"; | 766 | pname = "ldo-address"; |
772 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname); | 767 | res = platform_get_resource_byname(pdev, IORESOURCE_MEM, pname); |
773 | if (!res) { | ||
774 | dev_dbg(dev, "Missing '%s' IO resource\n", pname); | ||
775 | ret = -ENODEV; | ||
776 | goto skip_opt; | ||
777 | } | ||
778 | abb->ldo_base = devm_ioremap_resource(dev, res); | 768 | abb->ldo_base = devm_ioremap_resource(dev, res); |
779 | if (IS_ERR(abb->ldo_base)) { | 769 | if (IS_ERR(abb->ldo_base)) { |
780 | ret = PTR_ERR(abb->ldo_base); | 770 | ret = PTR_ERR(abb->ldo_base); |