Skip to content

Commit 733f41f

Browse files
bbkzzwsakernel
authored andcommitted
i2c: pxa: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Yangtao Li <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent b15eb80 commit 733f41f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/i2c/busses/i2c-pxa.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
13621362
struct i2c_pxa_platform_data *plat = dev_get_platdata(&dev->dev);
13631363
enum pxa_i2c_types i2c_type;
13641364
struct pxa_i2c *i2c;
1365-
struct resource *res = NULL;
1365+
struct resource *res;
13661366
int ret, irq;
13671367

13681368
i2c = devm_kzalloc(&dev->dev, sizeof(struct pxa_i2c), GFP_KERNEL);
@@ -1379,8 +1379,7 @@ static int i2c_pxa_probe(struct platform_device *dev)
13791379
i2c->adap.dev.of_node = dev->dev.of_node;
13801380
#endif
13811381

1382-
res = platform_get_resource(dev, IORESOURCE_MEM, 0);
1383-
i2c->reg_base = devm_ioremap_resource(&dev->dev, res);
1382+
i2c->reg_base = devm_platform_get_and_ioremap_resource(dev, 0, &res);
13841383
if (IS_ERR(i2c->reg_base))
13851384
return PTR_ERR(i2c->reg_base);
13861385

0 commit comments

Comments
 (0)