Skip to content

Commit 73c3bf7

Browse files
YueHaibingbebarino
authored andcommitted
clk: mediatek: mt2712: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 1f8f3c6 commit 73c3bf7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/mediatek/clk-mt2712.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,8 @@ static int clk_mt2712_top_probe(struct platform_device *pdev)
13061306
int r, i;
13071307
struct device_node *node = pdev->dev.of_node;
13081308
void __iomem *base;
1309-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
13101309

1311-
base = devm_ioremap_resource(&pdev->dev, res);
1310+
base = devm_platform_ioremap_resource(pdev, 0);
13121311
if (IS_ERR(base)) {
13131312
pr_err("%s(): ioremap failed\n", __func__);
13141313
return PTR_ERR(base);
@@ -1394,9 +1393,8 @@ static int clk_mt2712_mcu_probe(struct platform_device *pdev)
13941393
int r;
13951394
struct device_node *node = pdev->dev.of_node;
13961395
void __iomem *base;
1397-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
13981396

1399-
base = devm_ioremap_resource(&pdev->dev, res);
1397+
base = devm_platform_ioremap_resource(pdev, 0);
14001398
if (IS_ERR(base)) {
14011399
pr_err("%s(): ioremap failed\n", __func__);
14021400
return PTR_ERR(base);

0 commit comments

Comments
 (0)