Skip to content

Commit 793ee79

Browse files
wangbaolin719bebarino
authored andcommitted
clk: sprd: Change to use devm_platform_ioremap_resource()
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together, which can simpify the code. Signed-off-by: Baolin Wang <[email protected]> Link: https://lkml.kernel.org/r/841d26a2adb4bf3b4423f82a41dd3f1346413db6.1570520268.git.baolin.wang@linaro.org Signed-off-by: Stephen Boyd <[email protected]>
1 parent 56a5732 commit 793ee79

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/clk/sprd/common.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
4242
void __iomem *base;
4343
struct device_node *node = pdev->dev.of_node;
4444
struct regmap *regmap;
45-
struct resource *res;
4645

4746
if (of_find_property(node, "sprd,syscon", NULL)) {
4847
regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
@@ -51,8 +50,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
5150
return PTR_ERR(regmap);
5251
}
5352
} else {
54-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
55-
base = devm_ioremap_resource(&pdev->dev, res);
53+
base = devm_platform_ioremap_resource(pdev, 0);
5654
if (IS_ERR(base))
5755
return PTR_ERR(base);
5856

0 commit comments

Comments
 (0)