diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2013-08-19 07:20:37 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-10-09 09:14:38 -0400 |
commit | 8a7f431221602fcde573dfdba26de1990ec195a0 (patch) | |
tree | 926a3b5ac84c755dd068549b1e4f020888b8d5d8 | |
parent | d0e639c9e06d44e713170031fe05fb60ebe680af (diff) |
iommu/arm-smmu: replace devm_request_and_ioremap by devm_ioremap_resource
Use devm_ioremap_resource instead of devm_request_and_ioremap.
This was partly done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci
The error-handling code on the call to platform_get_resource was removed
manually, and the initialization of smmu->size was manually moved lower, to
take advantage of the NULL test on res performed by devm_ioremap_resource.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | drivers/iommu/arm-smmu.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 181c9ba929cd..abe83c3757ab 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
@@ -1781,15 +1781,10 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) | |||
1781 | smmu->dev = dev; | 1781 | smmu->dev = dev; |
1782 | 1782 | ||
1783 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1783 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1784 | if (!res) { | 1784 | smmu->base = devm_ioremap_resource(dev, res); |
1785 | dev_err(dev, "missing base address/size\n"); | 1785 | if (IS_ERR(smmu->base)) |
1786 | return -ENODEV; | 1786 | return PTR_ERR(smmu->base); |
1787 | } | ||
1788 | |||
1789 | smmu->size = resource_size(res); | 1787 | smmu->size = resource_size(res); |
1790 | smmu->base = devm_request_and_ioremap(dev, res); | ||
1791 | if (!smmu->base) | ||
1792 | return -EADDRNOTAVAIL; | ||
1793 | 1788 | ||
1794 | if (of_property_read_u32(dev->of_node, "#global-interrupts", | 1789 | if (of_property_read_u32(dev->of_node, "#global-interrupts", |
1795 | &smmu->num_global_irqs)) { | 1790 | &smmu->num_global_irqs)) { |