From patchwork Tue May 1 12:06:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Afzal X-Patchwork-Id: 156058 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 749C9B6FB4 for ; Tue, 1 May 2012 22:28:48 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SPCAN-0007bo-S1; Tue, 01 May 2012 12:26:52 +0000 Received: from arroyo.ext.ti.com ([192.94.94.40]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SPC7M-0005pk-6g; Tue, 01 May 2012 12:23:45 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q41CNYrY017428; Tue, 1 May 2012 07:23:34 -0500 Received: from DFLE70.ent.ti.com (dfle70.ent.ti.com [128.247.5.40]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q41CNY2P013912; Tue, 1 May 2012 07:23:34 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle70.ent.ti.com (128.247.5.40) with Microsoft SMTP Server id 14.1.323.3; Tue, 1 May 2012 07:23:34 -0500 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with SMTP id q41CNSrf004711; Tue, 1 May 2012 07:23:29 -0500 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id 0F989158002; Tue, 1 May 2012 17:53:28 +0530 (IST) Received: from linux-psp-server.india.ext.ti.com (linux-psp-server [192.168.247.76]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id q41CNRI18343; Tue, 1 May 2012 17:53:27 +0530 (IST) From: Afzal Mohammed To: , , , , , , , , , , , , , , , , Subject: [PATCH 06/39] ARM: OMAP2+: onenand: return value in init function Date: Tue, 1 May 2012 17:36:44 +0530 Message-ID: <91c09cb6a6cb5e87acdcc3f6100a87b4c2a3dd41.1335873032.git.afzal@ti.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.40 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Afzal Mohammed X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Modify board_onenand_init to return platform data. This would be required for boards to be able to pass it to gpmc driver so that it finally reaches onenand driver. Also un-static the function so that boards can use it. Signed-off-by: Afzal Mohammed --- arch/arm/mach-omap2/board-flash.c | 14 ++++---------- arch/arm/mach-omap2/board-flash.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index 091aaf6..8727c05 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c @@ -87,22 +87,16 @@ static struct omap_onenand_platform_data board_onenand_data = { .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ }; -static void -__init board_onenand_init(struct mtd_partition *onenand_parts, - u8 nr_parts, u8 cs) +struct omap_onenand_platform_data * __init +board_onenand_init(struct mtd_partition *onenand_parts, u8 nr_parts, u8 cs) { board_onenand_data.cs = cs; board_onenand_data.parts = onenand_parts; board_onenand_data.nr_parts = nr_parts; - gpmc_onenand_init(&board_onenand_data); -} -#else -static void -__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) -{ + return &board_onenand_data; } -#endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */ +#endif #if defined(CONFIG_MTD_NAND_OMAP2) || \ defined(CONFIG_MTD_NAND_OMAP2_MODULE) diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h index 052964c..75ba49f 100644 --- a/arch/arm/mach-omap2/board-flash.h +++ b/arch/arm/mach-omap2/board-flash.h @@ -52,3 +52,15 @@ board_nand_init(struct mtd_partition *nand_parts, return NULL; } #endif + +#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ + defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) +extern struct omap_onenand_platform_data * __init +board_onenand_init(struct mtd_partition *onenand_parts, u8 nr_parts, u8 cs); +#else +static inline struct omap_onenand_platform_data * +__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) +{ + return NULL; +} +#endif