Skip to content

Commit aa13600

Browse files
YueHaibingbebarino
authored andcommitted
clk: mediatek: mt7629: 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 ed4e1bb commit aa13600

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/mediatek/clk-mt7629.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,8 @@ static int mtk_topckgen_init(struct platform_device *pdev)
574574
struct clk_onecell_data *clk_data;
575575
void __iomem *base;
576576
struct device_node *node = pdev->dev.of_node;
577-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
578577

579-
base = devm_ioremap_resource(&pdev->dev, res);
578+
base = devm_platform_ioremap_resource(pdev, 0);
580579
if (IS_ERR(base))
581580
return PTR_ERR(base);
582581

@@ -626,9 +625,8 @@ static int mtk_pericfg_init(struct platform_device *pdev)
626625
void __iomem *base;
627626
int r;
628627
struct device_node *node = pdev->dev.of_node;
629-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
630628

631-
base = devm_ioremap_resource(&pdev->dev, res);
629+
base = devm_platform_ioremap_resource(pdev, 0);
632630
if (IS_ERR(base))
633631
return PTR_ERR(base);
634632

0 commit comments

Comments
 (0)