linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Michal Simek <michal.simek@xilinx.com>
Cc: linux-kernel@vger.kernel.org, monstr@monstr.eu,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v2 2/3] video: xilinxfb: Use devm_kzalloc instead of kzalloc
Date: Wed, 09 Oct 2013 15:13:03 +0000	[thread overview]
Message-ID: <1381331583.2050.11.camel@joe-AO722> (raw)
In-Reply-To: <748c16093663172918a90a53dc472cb8beb584ca.1381315928.git.michal.simek@xilinx.com>

On Wed, 2013-10-09 at 12:52 +0200, Michal Simek wrote:
> Simplify driver probe and release function.
[]
> diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
[]
> @@ -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.



  reply	other threads:[~2013-10-09 15:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-09 10:52 [PATCH v2 1/3] video: xilinxfb: Use standard variable name convention Michal Simek
2013-10-09 10:52 ` [PATCH v2 2/3] video: xilinxfb: Use devm_kzalloc instead of kzalloc Michal Simek
2013-10-09 15:13   ` Joe Perches [this message]
2013-10-10  6:24     ` Michal Simek
2013-10-09 10:52 ` [PATCH v2 3/3] video: xilinxfb: Simplify error path Michal Simek
     [not found] ` <631df9a44b366af4129d00f1d4e1d3baad7d4903.1381315928.git.michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2013-10-09 11:06   ` [PATCH v2 1/3] video: xilinxfb: Use standard variable name convention Mark Rutland
     [not found]     ` <20131009110651.GH4981-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2013-10-09 11:18       ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1381331583.2050.11.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=plagnioj@jcrosoft.com \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).