Skip to content

Commit 067de0a

Browse files
YueHaibingbebarino
authored andcommitted
clk: mediatek: mt8183: 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 71ae814 commit 067de0a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/clk/mediatek/clk-mt8183.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,11 +1189,10 @@ CLK_OF_DECLARE_DRIVER(mt8183_topckgen, "mediatek,mt8183-topckgen",
11891189

11901190
static int clk_mt8183_top_probe(struct platform_device *pdev)
11911191
{
1192-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
11931192
void __iomem *base;
11941193
struct device_node *node = pdev->dev.of_node;
11951194

1196-
base = devm_ioremap_resource(&pdev->dev, res);
1195+
base = devm_platform_ioremap_resource(pdev, 0);
11971196
if (IS_ERR(base))
11981197
return PTR_ERR(base);
11991198

@@ -1262,9 +1261,8 @@ static int clk_mt8183_mcu_probe(struct platform_device *pdev)
12621261
struct clk_onecell_data *clk_data;
12631262
struct device_node *node = pdev->dev.of_node;
12641263
void __iomem *base;
1265-
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
12661264

1267-
base = devm_ioremap_resource(&pdev->dev, res);
1265+
base = devm_platform_ioremap_resource(pdev, 0);
12681266
if (IS_ERR(base))
12691267
return PTR_ERR(base);
12701268

0 commit comments

Comments
 (0)