From patchwork Wed Feb 23 06:49:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh KUMAR X-Patchwork-Id: 84107 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D675AB70CD for ; Wed, 23 Feb 2011 17:52:22 +1100 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by bombadil.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1Ps8Y7-0006x3-Ht; Wed, 23 Feb 2011 06:50:11 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Ps8Y4-0006rM-JF; Wed, 23 Feb 2011 06:50:08 +0000 Received: from eu1sys200aog120.obsmtp.com ([207.126.144.149]) by canuck.infradead.org with smtps (Exim 4.72 #1 (Red Hat Linux)) id 1Ps8Xz-0006r0-GF for linux-mtd@lists.infradead.org; Wed, 23 Feb 2011 06:50:04 +0000 Received: from source ([138.198.100.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKTWSuEES2yzIeqOjVFSFN+DABkkCN5x4A@postini.com; Wed, 23 Feb 2011 06:50:03 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 23D30FA; Wed, 23 Feb 2011 06:49:32 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas1.st.com [10.80.176.8]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AC1299C8; Wed, 23 Feb 2011 06:49:32 +0000 (GMT) Received: from localhost (10.199.7.86) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.2.234.1; Wed, 23 Feb 2011 14:49:31 +0800 From: Viresh Kumar To: , , , Subject: [PATCH] fsmc-nand: Add fsmc_nand_set_plat_data in linux/mtd/fsmc.h Date: Wed, 23 Feb 2011 12:19:29 +0530 Message-ID: X-Mailer: git-send-email 1.7.2.2 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110223_015003_775527_E6B08680 X-CRM114-Status: GOOD ( 17.41 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [207.126.144.149 listed in list.dnswl.org] Cc: Vipin Kumar , Viresh Kumar X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 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 In most of the cases partitions info, width, etc comes from board files. And device structure may be defined in machine files, common to all board files. Thus, we need to set platform data from board file, for which fsmc_nand_set_plat_data routine is required. Signed-off-by: Viresh Kumar Signed-off-by: Vipin Kumar Acked-by: Linus Walleij --- include/linux/mtd/fsmc.h | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h index 6987995..0cba324 100644 --- a/include/linux/mtd/fsmc.h +++ b/include/linux/mtd/fsmc.h @@ -160,4 +160,21 @@ extern void __init fsmc_init_board_info(struct platform_device *pdev, struct mtd_partition *partitions, unsigned int nr_partitions, unsigned int width); +/* This function is used to set platform data field of pdev->dev */ +static inline void fsmc_nand_set_plat_data(struct platform_device *pdev, + struct mtd_partition *partitions, unsigned int nr_partitions, + unsigned int options, unsigned int width) +{ + struct fsmc_nand_platform_data *plat_data; + plat_data = dev_get_platdata(&pdev->dev); + + if (partitions) { + plat_data->partitions = partitions; + plat_data->nr_partitions = nr_partitions; + } + + plat_data->options = options; + plat_data->width = width; +} + #endif /* __MTD_FSMC_H */