Thread (7 messages) flat view 7 messages, 4 authors, 2013-10-10

Re: [PATCH v2 2/3] video: xilinxfb: Use devm_kzalloc instead of kzalloc

From: Joe Perches <joe@perches.com>
Date: 2013-10-09 15:13:10
Also in: lkml

On Wed, 2013-10-09 at 12:52 +0200, Michal Simek wrote:
Simplify driver probe and release function.
[]
quoted hunk ↗ jump to hunk
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
[]
quoted hunk ↗ jump to hunk
@@ -423,7 +419,7 @@ static int xilinxfb_of_probe(struct platform_device *pdev)
 	pdata = xilinx_fb_default_pdata;

 	/* Allocate the driver data region */
-	drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
+	drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
 	if (!drvdata) {
 		dev_err(&pdev->dev, "Couldn't allocate device private record\n");
Be nice to remove the unnecessary OOM message.
There's already a generic dump_stack on OOM.

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