Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316588
b: refs/heads/master
c: 0547c2f
h: refs/heads/master
v: v3
  • Loading branch information
Hiroshi Doyu authored and Joerg Roedel committed Jun 25, 2012
1 parent 074c614 commit a00d9e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a3b24915456b63c9002e94152e122b07de5566f2
refs/heads/master: 0547c2f56e6e4795d5366ba3b8483b668920a947
37 changes: 6 additions & 31 deletions trunk/drivers/iommu/tegra-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,51 +971,26 @@ static int tegra_smmu_probe(struct platform_device *pdev)
spin_lock_init(&smmu->lock);
err = smmu_setup_regs(smmu);
if (err)
goto fail;
return err;
platform_set_drvdata(pdev, smmu);

smmu->avp_vector_page = alloc_page(GFP_KERNEL);
if (!smmu->avp_vector_page)
goto fail;
return -ENOMEM;

smmu_handle = smmu;
return 0;

fail:
if (smmu->avp_vector_page)
__free_page(smmu->avp_vector_page);
if (smmu && smmu->as) {
for (i = 0; i < smmu->num_as; i++) {
if (smmu->as[i].pdir_page) {
ClearPageReserved(smmu->as[i].pdir_page);
__free_page(smmu->as[i].pdir_page);
}
}
devm_kfree(dev, smmu->as);
}
devm_kfree(dev, smmu);
return err;
}

static int tegra_smmu_remove(struct platform_device *pdev)
{
struct smmu_device *smmu = platform_get_drvdata(pdev);
struct device *dev = smmu->dev;
int i;

smmu_write(smmu, SMMU_CONFIG_DISABLE, SMMU_CONFIG);
platform_set_drvdata(pdev, NULL);
if (smmu->as) {
int i;

for (i = 0; i < smmu->num_as; i++)
free_pdir(&smmu->as[i]);
devm_kfree(dev, smmu->as);
}
if (smmu->avp_vector_page)
__free_page(smmu->avp_vector_page);
if (smmu->regs)
devm_iounmap(dev, smmu->regs);
devm_kfree(dev, smmu);
for (i = 0; i < smmu->num_as; i++)
free_pdir(&smmu->as[i]);
__free_page(smmu->avp_vector_page);
smmu_handle = NULL;
return 0;
}
Expand Down

0 comments on commit a00d9e3

Please sign in to comment.