mfd: hi655x-pmic: Convert to devm_platform_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Thu, 6 Jul 2023 11:39:39 +0000 (19:39 +0800)
committerLee Jones <lee@kernel.org>
Fri, 18 Aug 2023 20:48:00 +0000 (21:48 +0100)
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230706113939.1178-7-frank.li@vivo.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/hi655x-pmic.c
include/linux/mfd/hi655x-pmic.h

index a58e42d..98ae40e 100644 (file)
@@ -100,8 +100,7 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
                return -ENOMEM;
        pmic->dev = dev;
 
-       pmic->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(dev, pmic->res);
+       base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(base))
                return PTR_ERR(base);
 
index 6a01278..1945568 100644 (file)
@@ -52,7 +52,6 @@
 #define OTMP_D1R_INT_MASK               BIT(OTMP_D1R_INT)
 
 struct hi655x_pmic {
-       struct resource *res;
        struct device *dev;
        struct regmap *regmap;
        struct gpio_desc *gpio;