linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Krzysztof Helt <krzysztof.h1@poczta.fm>
Cc: linuxppc-dev@ozlabs.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux-fbdev-devel <linux-fbdev-devel@lists.sourceforge.net>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [Linux-fbdev-devel] [PATCH] offb: use framebuffer_alloc() to allocate fb_info struct
Date: Fri, 15 May 2009 16:28:34 +1000	[thread overview]
Message-ID: <1242368914.22331.18.camel@pasglop> (raw)
In-Reply-To: <20090504190724.c2dfb53c.krzysztof.h1@poczta.fm>

On Mon, 2009-05-04 at 19:07 +0200, Krzysztof Helt wrote:
> From: Krzysztof Helt <krzysztof.h1@wp.pl>
> 
> Use the framebuffer_alloc() function to allocate the fb_info
> structure so the structure is correctly initialized after allocation.
> 
> Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

> ---
> 
> diff -urp linux-orig/drivers/video/offb.c linux-2.6.30/drivers/video/offb.c
> --- linux-orig/drivers/video/offb.c	2008-08-09 05:09:05.000000000 +0200
> +++ linux-2.6.30/drivers/video/offb.c	2009-05-04 00:14:28.000000000 +0200
> @@ -378,7 +378,6 @@ static void __init offb_init_fb(const ch
>  	struct fb_fix_screeninfo *fix;
>  	struct fb_var_screeninfo *var;
>  	struct fb_info *info;
> -	int size;
>  
>  	if (!request_mem_region(res_start, res_size, "offb"))
>  		return;
> @@ -393,15 +392,12 @@ static void __init offb_init_fb(const ch
>  		return;
>  	}
>  
> -	size = sizeof(struct fb_info) + sizeof(u32) * 16;
> -
> -	info = kmalloc(size, GFP_ATOMIC);
> +	info = framebuffer_alloc(sizeof(u32) * 16, NULL);
>  	
>  	if (info == 0) {
>  		release_mem_region(res_start, res_size);
>  		return;
>  	}
> -	memset(info, 0, size);
>  
>  	fix = &info->fix;
>  	var = &info->var;
> 
> ----------------------------------------------------------------------
> Wygraj 3000 zl, wycieczke lub lot balonem!
> Sprawdz >> http://link.interia.pl/f2154
> 
> 
> ------------------------------------------------------------------------------
> Register Now & Save for Velocity, the Web Performance & Operations 
> Conference from O'Reilly Media. Velocity features a full day of 
> expert-led, hands-on workshops and two days of sessions from industry 
> leaders in dedicated Performance & Operations tracks. Use code vel09scf 
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> _______________________________________________
> Linux-fbdev-devel mailing list
> Linux-fbdev-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

      reply	other threads:[~2009-05-15  6:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-04 17:07 [PATCH] offb: use framebuffer_alloc() to allocate fb_info struct Krzysztof Helt
2009-05-15  6:28 ` Benjamin Herrenschmidt [this message]

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=1242368914.22331.18.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=akpm@linux-foundation.org \
    --cc=geert@linux-m68k.org \
    --cc=krzysztof.h1@poczta.fm \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linuxppc-dev@ozlabs.org \
    /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).