mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 00:59:06 +00:00
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 <baolin.wang@linaro.org> Link: https://lkml.kernel.org/r/841d26a2adb4bf3b4423f82a41dd3f1346413db6.1570520268.git.baolin.wang@linaro.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
56a5732139
commit
793ee798cc
1 changed files with 1 additions and 3 deletions
|
@ -42,7 +42,6 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
struct device_node *node = pdev->dev.of_node;
|
struct device_node *node = pdev->dev.of_node;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
struct resource *res;
|
|
||||||
|
|
||||||
if (of_find_property(node, "sprd,syscon", NULL)) {
|
if (of_find_property(node, "sprd,syscon", NULL)) {
|
||||||
regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
|
regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
|
||||||
|
@ -51,8 +50,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
|
||||||
return PTR_ERR(regmap);
|
return PTR_ERR(regmap);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
base = devm_ioremap_resource(&pdev->dev, res);
|
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue