Commit 3c2588fa authored by Baolin Wang's avatar Baolin Wang Committed by Wolfram Sang

i2c: sprd: Change to use devm_platform_ioremap_resource()

Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 4d7802aa
...@@ -478,7 +478,6 @@ static int sprd_i2c_probe(struct platform_device *pdev) ...@@ -478,7 +478,6 @@ static int sprd_i2c_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct sprd_i2c *i2c_dev; struct sprd_i2c *i2c_dev;
struct resource *res;
u32 prop; u32 prop;
int ret; int ret;
...@@ -488,8 +487,7 @@ static int sprd_i2c_probe(struct platform_device *pdev) ...@@ -488,8 +487,7 @@ static int sprd_i2c_probe(struct platform_device *pdev)
if (!i2c_dev) if (!i2c_dev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); i2c_dev->base = devm_platform_ioremap_resource(pdev, 0);
i2c_dev->base = devm_ioremap_resource(dev, res);
if (IS_ERR(i2c_dev->base)) if (IS_ERR(i2c_dev->base))
return PTR_ERR(i2c_dev->base); return PTR_ERR(i2c_dev->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