Thread (24 messages) flat view 24 messages, 5 authors, 2014-08-01

[PATCH 02/13] uio: uio_pruss: use devm_kzalloc()

From: mark.rutland@arm.com (Mark Rutland)
Date: 2014-06-30 09:38:09
Also in: linux-devicetree, linux-omap

On Sun, Jun 29, 2014 at 05:21:36PM +0100, Andre Heider wrote:
quoted hunk ↗ jump to hunk
Replace kzalloc() by devm_kzalloc() and remove the kfree() calls.

Signed-off-by: Andre Heider <redacted>
---
 drivers/uio/uio_pruss.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
index c28d6e2..f07545b 100644
--- a/drivers/uio/uio_pruss.c
+++ b/drivers/uio/uio_pruss.c
@@ -109,9 +109,7 @@ static void pruss_cleanup(struct device *dev, struct uio_pruss_dev *gdev)
 		gen_pool_free(gdev->sram_pool,
 			      gdev->sram_vaddr,
 			      sram_pool_sz);
-	kfree(gdev->info);
 	clk_put(gdev->pruss_clk);
-	kfree(gdev);
 }
 
 static int pruss_probe(struct platform_device *pdev)
@@ -123,24 +121,19 @@ static int pruss_probe(struct platform_device *pdev)
 	int ret = -ENODEV, cnt = 0, len;
 	struct uio_pruss_pdata *pdata = dev_get_platdata(dev);
 
-	gdev = kzalloc(sizeof(struct uio_pruss_dev), GFP_KERNEL);
+	gdev = devm_kzalloc(dev, sizeof(struct uio_pruss_dev), GFP_KERNEL);
If this is changing anyway, how about:

	gdev = devm_kzalloc(dev, sizeof(*gdev), GFP_KERNEL);

Cheers,
Mark.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help