From patchwork Mon May 4 17:07:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Helt X-Patchwork-Id: 26852 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id B9FA1B707D for ; Tue, 5 May 2009 03:28:56 +1000 (EST) Received: by ozlabs.org (Postfix) id 512B0DDECA; Tue, 5 May 2009 03:28:49 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 4A2E7DDE1F for ; Tue, 5 May 2009 03:28:49 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org X-Greylist: delayed 1537 seconds by postgrey-1.31 at ozlabs; Tue, 05 May 2009 03:28:28 EST Received: from smtp239.poczta.interia.pl (smtp239.poczta.interia.pl [217.74.64.239]) by ozlabs.org (Postfix) with ESMTP id B2960DDE0D for ; Tue, 5 May 2009 03:28:28 +1000 (EST) Received: by smtp239.poczta.interia.pl (INTERIA.PL, from userid 502) id C1502370D01; Mon, 4 May 2009 19:02:47 +0200 (CEST) Received: from poczta.interia.pl (mi02.poczta.interia.pl [10.217.12.2]) by smtp239.poczta.interia.pl (INTERIA.PL) with ESMTP id 56024370D64; Mon, 4 May 2009 19:02:46 +0200 (CEST) Received: by poczta.interia.pl (INTERIA.PL, from userid 502) id 28D7B2BC510; Mon, 4 May 2009 19:02:46 +0200 (CEST) Received: from krzysio.net (93-181-133-4.as.kn.pl [93.181.133.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by www.poczta.fm (INTERIA.PL) with ESMTP id 030DE2BC684; Mon, 4 May 2009 19:02:41 +0200 (CEST) Date: Mon, 4 May 2009 19:07:24 +0200 From: Krzysztof Helt To: Linux-fbdev-devel Subject: [PATCH] offb: use framebuffer_alloc() to allocate fb_info struct Message-Id: <20090504190724.c2dfb53c.krzysztof.h1@poczta.fm> X-Mailer: Sylpheed 2.4.3 (GTK+ 2.11.0; i686-pc-linux-gnu) Mime-Version: 1.0 X-EMID: 94c0b138 Cc: linuxppc-dev@ozlabs.org, Andrew Morton , Geert Uytterhoeven X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org From: Krzysztof Helt Use the framebuffer_alloc() function to allocate the fb_info structure so the structure is correctly initialized after allocation. Signed-off-by: Krzysztof Helt Acked-by: Benjamin Herrenschmidt --- ---------------------------------------------------------------------- Wygraj 3000 zl, wycieczke lub lot balonem! Sprawdz >> http://link.interia.pl/f2154 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;