From patchwork Tue Apr 3 08:17:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 150336 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 245DFB6FD8 for ; Tue, 3 Apr 2012 18:19:56 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SEyvt-0006cQ-VF; Tue, 03 Apr 2012 08:17:42 +0000 Received: from [2002:4e20:1eda::1] (helo=caramon.arm.linux.org.uk) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SEyvq-0006cD-SM for linux-arm-kernel@lists.infradead.org; Tue, 03 Apr 2012 08:17:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=caramon; h=Sender:Content-Type:MIME-Version:Message-ID:Subject:Cc:To:From:Date; bh=1yB2NaOVH9SVaK7lQFOSWeHaZz1Pl67vhqV+qLUaeSU=; b=BdaMNIANduTpl47yJvT6s3VVwy3QUvZBx8wE+Cn7Pp35lRoqmb7G3vo0vx64p6Su2XiPA/m7t5IipiOWNTonmSdyO4TNpCAM4rEQfAyZ8t25/uMGOFtpHZj17k/5058+V3IxGDFenLYfpirgNzPU2Xic6vvBZTzW7/KmmoGkVd0=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:48995) by caramon.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1SEyva-0000lA-Lq; Tue, 03 Apr 2012 09:17:23 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1SEyvZ-0006UR-Cv; Tue, 03 Apr 2012 09:17:21 +0100 Date: Tue, 3 Apr 2012 09:17:21 +0100 From: Russell King - ARM Linux To: Javier Martin , Sascha Hauer , kernel@pengutronix.de Subject: [PATCH] Use arm_memblock_steal Message-ID: <20120403081720.GP24211@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Use the provided function rather than re-coding this bit of code. This also gets us protection against using these functions from invalid contexts. Signed-off-by: Russell King Acked-by: Sascha Hauer Tested-by: Javier Martin --- Please test this; I've not even compile tested this. Thanks. arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index f7b074f..c27058e 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c @@ -32,12 +32,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include @@ -193,10 +193,8 @@ static void __init visstrim_camera_init(void) static void __init visstrim_reserve(void) { /* reserve 4 MiB for mx2-camera */ - mx2_camera_base = memblock_alloc(MX2_CAMERA_BUF_SIZE, + mx2_camera_base = arm_memblock_steal(MX2_CAMERA_BUF_SIZE, MX2_CAMERA_BUF_SIZE); - memblock_free(mx2_camera_base, MX2_CAMERA_BUF_SIZE); - memblock_remove(mx2_camera_base, MX2_CAMERA_BUF_SIZE); } /* GPIOs used as events for applications */