Commit 28993472 authored by Qilong Zhang's avatar Qilong Zhang Committed by Bjorn Andersson

soc: qcom: llcc: use devm_platform_ioremap_resource_byname()

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20200916111517.99670-1-zhangqilong3@huawei.comSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent ba34f977
...@@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev) ...@@ -387,7 +387,6 @@ static int qcom_llcc_remove(struct platform_device *pdev)
static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
const char *name) const char *name)
{ {
struct resource *res;
void __iomem *base; void __iomem *base;
struct regmap_config llcc_regmap_config = { struct regmap_config llcc_regmap_config = {
.reg_bits = 32, .reg_bits = 32,
...@@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev, ...@@ -396,11 +395,7 @@ static struct regmap *qcom_llcc_init_mmio(struct platform_device *pdev,
.fast_io = true, .fast_io = true,
}; };
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); base = devm_platform_ioremap_resource_byname(pdev, name);
if (!res)
return ERR_PTR(-ENODEV);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return ERR_CAST(base); return ERR_CAST(base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment