Skip to contentSkip to conversation

iommu: arm-smmu: drop devm_free_irq when driver detach

PATCH Superseded Peng Fan 2 participants 2 messages Jul 12, 2016 IOMMU

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 iommu: arm-smmu: drop devm_free_irq when driver detach

There is no need to call devm_free_irq when driver detach. devres_release_all which is called after 'drv->remove' will release all managed resources.

Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>
---
 drivers/iommu/arm-smmu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iommu/arm-smmu.c +0 -3
index 860652e..5837391c 100644
@@ -2045,9 +2045,6 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
 	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
 		dev_err(dev, "removing device with active domains!\n");
 
-	for (i = 0; i < smmu->num_global_irqs; ++i)
-		devm_free_irq(smmu->dev, smmu->irqs[i], smmu);
-
 	/* Turn the thing off */
 	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
 	return 0;
Signature · 1 line
2.6.2
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Peng Fan

There is no need to call devm_free_irq when driver detach. devres_release_all which is called after 'drv->remove' will release all managed resources.

Cc Will Deacon <[email protected]>
Cc Robin Murphy <[email protected]>

drivers/iommu/arm-smmu.c: In function 'arm_smmu_device_remove':
drivers/iommu/arm-smmu.c:2021:6: warning: unused variable 'i' [-Wunused-variable]

  int i;
      ^

With that addressed:

Quoted 19 lines
---
 drivers/iommu/arm-smmu.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/iommu/arm-smmu.c +0 -3
index 860652e..5837391c 100644
@@ -2045,9 +2045,6 @@ static int arm_smmu_device_remove(struct platform_device *pdev)
 	if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
 		dev_err(dev, "removing device with active domains!\n");
 
-	for (i = 0; i < smmu->num_global_irqs; ++i)
-		devm_free_irq(smmu->dev, smmu->irqs[i], smmu);
-
 	/* Turn the thing off */
 	writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
 	return 0;