Skip to content

Commit 3152893

Browse files
ye xingchenwsakernel
authored andcommitted
i2c: wmt: 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]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent acdaf0e commit 3152893

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/i2c/busses/i2c-wmt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,16 +372,14 @@ static int wmt_i2c_probe(struct platform_device *pdev)
372372
struct device_node *np = pdev->dev.of_node;
373373
struct wmt_i2c_dev *i2c_dev;
374374
struct i2c_adapter *adap;
375-
struct resource *res;
376375
int err;
377376
u32 clk_rate;
378377

379378
i2c_dev = devm_kzalloc(&pdev->dev, sizeof(*i2c_dev), GFP_KERNEL);
380379
if (!i2c_dev)
381380
return -ENOMEM;
382381

383-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
384-
i2c_dev->base = devm_ioremap_resource(&pdev->dev, res);
382+
i2c_dev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
385383
if (IS_ERR(i2c_dev->base))
386384
return PTR_ERR(i2c_dev->base);
387385

0 commit comments

Comments
 (0)