Commit 907becb2 authored by YueHaibing's avatar YueHaibing Committed by Mark Brown

regulator: uniphier: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20191009150203.8052-1-yuehaibing@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 73511a90
...@@ -45,7 +45,6 @@ static int uniphier_regulator_probe(struct platform_device *pdev) ...@@ -45,7 +45,6 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
struct regulator_config config = { }; struct regulator_config config = { };
struct regulator_dev *rdev; struct regulator_dev *rdev;
struct regmap *regmap; struct regmap *regmap;
struct resource *res;
void __iomem *base; void __iomem *base;
const char *name; const char *name;
int i, ret, nr; int i, ret, nr;
...@@ -58,8 +57,7 @@ static int uniphier_regulator_probe(struct platform_device *pdev) ...@@ -58,8 +57,7 @@ static int uniphier_regulator_probe(struct platform_device *pdev)
if (WARN_ON(!priv->data)) if (WARN_ON(!priv->data))
return -EINVAL; return -EINVAL;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
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