linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iommu/tegra: gart: Remove unnecessary cleanup with devm_*()
@ 2012-05-14 18:12 Hiroshi DOYU
  2012-05-14 18:12 ` [PATCH 2/2] iommu/tegra: gart: Reserve iomem resource Hiroshi DOYU
       [not found] ` <1337019127-6863-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Hiroshi DOYU @ 2012-05-14 18:12 UTC (permalink / raw)
  To: hdoyu-DDmLM1+adcrQT0dZR+AlfA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Joerg Roedel, Stephen Warren,
	Bharat Nihalani, Vandana Salve,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Remove unnecessary cleanup procedures with devm_*().

Signed-off-by: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/iommu/tegra-gart.c |   22 +++-------------------
 1 files changed, 3 insertions(+), 19 deletions(-)

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;
 }
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-06-20 16:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-14 18:12 [PATCH 1/2] iommu/tegra: gart: Remove unnecessary cleanup with devm_*() Hiroshi DOYU
2012-05-14 18:12 ` [PATCH 2/2] iommu/tegra: gart: Reserve iomem resource Hiroshi DOYU
     [not found]   ` <1337019127-6863-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-05-21 14:11     ` Thierry Reding
2012-05-21 16:41       ` Stephen Warren
     [not found]         ` <4FBA702A.1010203-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-05-21 17:05           ` Lucas Stach
2012-05-21 17:14             ` Stephen Warren
     [not found]               ` <4FBA77E2.4000409-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-05-21 17:31                 ` Thierry Reding
2012-05-21 17:38                   ` Lucas Stach
2012-06-18 10:37                     ` Hiroshi Doyu
     [not found]                       ` <20120618133736.8d23c4e70b34b1de8cb71f6f-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-18 21:14                         ` Lucas Stach
2012-06-20  7:04                           ` [PATCH 1/2] iommu/tegra: gart: Remove unnecessary cleanup with devm_*() Hiroshi DOYU
     [not found]                             ` <1340175873-12531-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-20  7:04                               ` [PATCH 2/2] iommu/tegra: gart: Reserve iomem resource Hiroshi DOYU
     [not found]                                 ` <1340175873-12531-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-20 16:01                                   ` Stephen Warren
2012-06-20 16:00                               ` [PATCH 1/2] iommu/tegra: gart: Remove unnecessary cleanup with devm_*() Stephen Warren
     [not found]                   ` <20120521173124.GB11824-RM9K5IK7kjIQXX3q8xo1gnVAuStQJXxyR5q1nwbD4aMs9pC9oP6+/A@public.gmane.org>
2012-05-21 17:38                     ` [PATCH 2/2] iommu/tegra: gart: Reserve iomem resource Thierry Reding
     [not found] ` <1337019127-6863-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-05-21 14:16   ` [PATCH 1/2] iommu/tegra: gart: Remove unnecessary cleanup with devm_*() Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).