diff mbox

[1/2] iommu/tegra: gart: Remove unnecessary cleanup with devm_*()

Message ID 1340175873-12531-1-git-send-email-hdoyu@nvidia.com
State Not Applicable, archived
Headers show

Commit Message

Hiroshi Doyu June 20, 2012, 7:04 a.m. UTC
From: Hiroshi DOYU <hdoyu@nvidia.com>

Remove unnecessary cleanup procedures with devm_*().

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Lucas Stach <dev@lynxeye.de>
---
 drivers/iommu/tegra-gart.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)

Comments

Stephen Warren June 20, 2012, 4 p.m. UTC | #1
On 06/20/2012 01:04 AM, Hiroshi DOYU wrote:
> From: Hiroshi DOYU <hdoyu@nvidia.com>
> 
> Remove unnecessary cleanup procedures with devm_*().
> 
> Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
> Cc: Lucas Stach <dev@lynxeye.de>

Acked-by: Stephen Warren <swarren@wwwdotorg.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index 0c0a377..33a23b6 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -345,7 +345,6 @@  static int tegra_gart_probe(struct platform_device *pdev)
 	struct gart_device *gart;
 	struct resource *res, *res_remap;
 	void __iomem *gart_regs;
-	int err;
 	struct device *dev = &pdev->dev;
 
 	if (gart_handle)
@@ -370,8 +369,7 @@  static int tegra_gart_probe(struct platform_device *pdev)
 	gart_regs = devm_ioremap(dev, res->start, resource_size(res));
 	if (!gart_regs) {
 		dev_err(dev, "failed to remap GART registers\n");
-		err = -ENXIO;
-		goto fail;
+		return -ENXIO;
 	}
 
 	gart->dev = &pdev->dev;
@@ -385,8 +383,7 @@  static int tegra_gart_probe(struct platform_device *pdev)
 	gart->savedata = vmalloc(sizeof(u32) * gart->page_count);
 	if (!gart->savedata) {
 		dev_err(dev, "failed to allocate context save area\n");
-		err = -ENOMEM;
-		goto fail;
+		return -ENOMEM;
 	}
 
 	platform_set_drvdata(pdev, gart);
@@ -394,27 +391,14 @@  static int tegra_gart_probe(struct platform_device *pdev)
 
 	gart_handle = gart;
 	return 0;
-
-fail:
-	if (gart_regs)
-		devm_iounmap(dev, gart_regs);
-	if (gart && gart->savedata)
-		vfree(gart->savedata);
-	devm_kfree(dev, gart);
-	return err;
 }
 
 static int tegra_gart_remove(struct platform_device *pdev)
 {
 	struct gart_device *gart = platform_get_drvdata(pdev);
-	struct device *dev = gart->dev;
 
 	writel(0, gart->regs + GART_CONFIG);
-	if (gart->savedata)
-		vfree(gart->savedata);
-	if (gart->regs)
-		devm_iounmap(dev, gart->regs);
-	devm_kfree(dev, gart);
+	vfree(gart->savedata);
 	gart_handle = NULL;
 	return 0;
 }