i2c: sprd: Change to use devm_platform_ioremap_resource()
authorBaolin Wang <baolin.wang@linaro.org>
Thu, 25 Jul 2019 07:56:17 +0000 (15:56 +0800)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 6 Aug 2019 20:54:23 +0000 (22:54 +0200)
Use the new helper that wraps the calls to platform_get_resource()
and devm_ioremap_resource() together.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-sprd.c

index 8002835..bbcb056 100644 (file)
@@ -478,7 +478,6 @@ static int sprd_i2c_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct sprd_i2c *i2c_dev;
-       struct resource *res;
        u32 prop;
        int ret;
 
@@ -488,8 +487,7 @@ static int sprd_i2c_probe(struct platform_device *pdev)
        if (!i2c_dev)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       i2c_dev->base = devm_ioremap_resource(dev, res);
+       i2c_dev->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(i2c_dev->base))
                return PTR_ERR(i2c_dev->base);