Commit c8b0de76 authored by YueHaibing's avatar YueHaibing Committed by Will Deacon

perf/smmuv3: 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: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 504db0f8
...@@ -727,7 +727,7 @@ static void smmu_pmu_get_acpi_options(struct smmu_pmu *smmu_pmu) ...@@ -727,7 +727,7 @@ static void smmu_pmu_get_acpi_options(struct smmu_pmu *smmu_pmu)
static int smmu_pmu_probe(struct platform_device *pdev) static int smmu_pmu_probe(struct platform_device *pdev)
{ {
struct smmu_pmu *smmu_pmu; struct smmu_pmu *smmu_pmu;
struct resource *res_0, *res_1; struct resource *res_0;
u32 cfgr, reg_size; u32 cfgr, reg_size;
u64 ceid_64[2]; u64 ceid_64[2];
int irq, err; int irq, err;
...@@ -764,8 +764,7 @@ static int smmu_pmu_probe(struct platform_device *pdev) ...@@ -764,8 +764,7 @@ static int smmu_pmu_probe(struct platform_device *pdev)
/* Determine if page 1 is present */ /* Determine if page 1 is present */
if (cfgr & SMMU_PMCG_CFGR_RELOC_CTRS) { if (cfgr & SMMU_PMCG_CFGR_RELOC_CTRS) {
res_1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); smmu_pmu->reloc_base = devm_platform_ioremap_resource(pdev, 1);
smmu_pmu->reloc_base = devm_ioremap_resource(dev, res_1);
if (IS_ERR(smmu_pmu->reloc_base)) if (IS_ERR(smmu_pmu->reloc_base))
return PTR_ERR(smmu_pmu->reloc_base); return PTR_ERR(smmu_pmu->reloc_base);
} else { } else {
......
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