diff options
author | Hiroshi Doyu <hdoyu@nvidia.com> | 2012-06-25 07:23:57 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2012-06-25 07:50:44 -0400 |
commit | 0547c2f56e6e4795d5366ba3b8483b668920a947 (patch) | |
tree | 7ff1b14e016fa127c63e92dd1ea9b28873500107 /drivers/iommu/tegra-smmu.c | |
parent | a3b24915456b63c9002e94152e122b07de5566f2 (diff) |
iommu/tegra: smmu: Remove unnecessary cleanups with devm_*()
Remove unnecessary cleanup procedures with devm_*() functions.
Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'drivers/iommu/tegra-smmu.c')
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 98fcc7268eaf..cc6aba45e49a 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c | |||
@@ -971,51 +971,26 @@ static int tegra_smmu_probe(struct platform_device *pdev) | |||
971 | spin_lock_init(&smmu->lock); | 971 | spin_lock_init(&smmu->lock); |
972 | err = smmu_setup_regs(smmu); | 972 | err = smmu_setup_regs(smmu); |
973 | if (err) | 973 | if (err) |
974 | goto fail; | 974 | return err; |
975 | platform_set_drvdata(pdev, smmu); | 975 | platform_set_drvdata(pdev, smmu); |
976 | 976 | ||
977 | smmu->avp_vector_page = alloc_page(GFP_KERNEL); | 977 | smmu->avp_vector_page = alloc_page(GFP_KERNEL); |
978 | if (!smmu->avp_vector_page) | 978 | if (!smmu->avp_vector_page) |
979 | goto fail; | 979 | return -ENOMEM; |
980 | 980 | ||
981 | smmu_handle = smmu; | 981 | smmu_handle = smmu; |
982 | return 0; | 982 | return 0; |
983 | |||
984 | fail: | ||
985 | if (smmu->avp_vector_page) | ||
986 | __free_page(smmu->avp_vector_page); | ||
987 | if (smmu && smmu->as) { | ||
988 | for (i = 0; i < smmu->num_as; i++) { | ||
989 | if (smmu->as[i].pdir_page) { | ||
990 | ClearPageReserved(smmu->as[i].pdir_page); | ||
991 | __free_page(smmu->as[i].pdir_page); | ||
992 | } | ||
993 | } | ||
994 | devm_kfree(dev, smmu->as); | ||
995 | } | ||
996 | devm_kfree(dev, smmu); | ||
997 | return err; | ||
998 | } | 983 | } |
999 | 984 | ||
1000 | static int tegra_smmu_remove(struct platform_device *pdev) | 985 | static int tegra_smmu_remove(struct platform_device *pdev) |
1001 | { | 986 | { |
1002 | struct smmu_device *smmu = platform_get_drvdata(pdev); | 987 | struct smmu_device *smmu = platform_get_drvdata(pdev); |
1003 | struct device *dev = smmu->dev; | 988 | int i; |
1004 | 989 | ||
1005 | smmu_write(smmu, SMMU_CONFIG_DISABLE, SMMU_CONFIG); | 990 | smmu_write(smmu, SMMU_CONFIG_DISABLE, SMMU_CONFIG); |
1006 | platform_set_drvdata(pdev, NULL); | 991 | for (i = 0; i < smmu->num_as; i++) |
1007 | if (smmu->as) { | 992 | free_pdir(&smmu->as[i]); |
1008 | int i; | 993 | __free_page(smmu->avp_vector_page); |
1009 | |||
1010 | for (i = 0; i < smmu->num_as; i++) | ||
1011 | free_pdir(&smmu->as[i]); | ||
1012 | devm_kfree(dev, smmu->as); | ||
1013 | } | ||
1014 | if (smmu->avp_vector_page) | ||
1015 | __free_page(smmu->avp_vector_page); | ||
1016 | if (smmu->regs) | ||
1017 | devm_iounmap(dev, smmu->regs); | ||
1018 | devm_kfree(dev, smmu); | ||
1019 | smmu_handle = NULL; | 994 | smmu_handle = NULL; |
1020 | return 0; | 995 | return 0; |
1021 | } | 996 | } |