Skip to content

Commit ed4e1bb

Browse files
YueHaibingbebarino
authored andcommitted
clk: mediatek: mt7622: 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 067de0a commit ed4e1bb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/mediatek/clk-mt7622.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,8 @@ static int mtk_topckgen_init(struct platform_device *pdev)
614614
struct clk_onecell_data *clk_data;
615615
void __iomem *base;
616616
struct device_node *node = pdev->dev.of_node;
617-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
618617

619-
base = devm_ioremap_resource(&pdev->dev, res);
618+
base = devm_platform_ioremap_resource(pdev, 0);
620619
if (IS_ERR(base))
621620
return PTR_ERR(base);
622621

@@ -695,9 +694,8 @@ static int mtk_pericfg_init(struct platform_device *pdev)
695694
void __iomem *base;
696695
int r;
697696
struct device_node *node = pdev->dev.of_node;
698-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
699697

700-
base = devm_ioremap_resource(&pdev->dev, res);
698+
base = devm_platform_ioremap_resource(pdev, 0);
701699
if (IS_ERR(base))
702700
return PTR_ERR(base);
703701

0 commit comments

Comments
 (0)