Skip to content

Commit acdaf0e

Browse files
ye xingchenwsakernel
authored andcommitted
i2c: versatile: 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: ye xingchen <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 0520628 commit acdaf0e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/i2c/busses/i2c-versatile.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ static const struct i2c_algo_bit_data i2c_versatile_algo = {
6464
static int i2c_versatile_probe(struct platform_device *dev)
6565
{
6666
struct i2c_versatile *i2c;
67-
struct resource *r;
6867
int ret;
6968

7069
i2c = devm_kzalloc(&dev->dev, sizeof(struct i2c_versatile), GFP_KERNEL);
7170
if (!i2c)
7271
return -ENOMEM;
7372

74-
r = platform_get_resource(dev, IORESOURCE_MEM, 0);
75-
i2c->base = devm_ioremap_resource(&dev->dev, r);
73+
i2c->base = devm_platform_get_and_ioremap_resource(dev, 0, NULL);
7674
if (IS_ERR(i2c->base))
7775
return PTR_ERR(i2c->base);
7876

0 commit comments

Comments
 (0)