Skip to contentSkip to conversation

mxc_nand: add support for platform defined partitions

PATCH Superseded Baruch Siach 2 participants 2 messages May 27, 2010

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mxc_nand: add support for platform defined partitions

---
 arch/arm/plat-mxc/include/mach/mxc_nand.h |    4 ++++
 drivers/mtd/nand/mxc_nand.c               |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/include/mach/mxc_nand.h +4 -0
index 5d2d21d..a07bae9 100644
@@ -20,9 +20,13 @@
 #ifndef __ASM_ARCH_NAND_H
 #define __ASM_ARCH_NAND_H
 
+#include <linux/mtd/partitions.h>
+
 struct mxc_nand_platform_data {
 	int width;	/* data bus width in bytes */
 	int hw_ecc:1;	/* 0 if supress hardware ECC */
 	int flash_bbt:1; /* set to 1 to use a flash based bbt */
+	struct mtd_partition	*parts;	/* partition table */
+	int			nr_parts; /* size of parts */
 };
 #endif /* __ASM_ARCH_NAND_H */
drivers/mtd/nand/mxc_nand.c +2 -0
index b2900d8..4f615d2 100644
@@ -838,6 +838,8 @@ static int __init mxcnd_probe(struct platform_device *pdev)
 	    parse_mtd_partitions(mtd, part_probes, &host->parts, 0);
 	if (nr_parts > 0)
 		add_mtd_partitions(mtd, host->parts, nr_parts);
+	else if (pdata->parts)
+		add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
 	else
 #endif
 	{
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 mxc_nand: add support for platform defined partitions

Quoted 1 line · Baruch Siach

Just coding style comments from me, see inline

Quoted 11 lines
---
 arch/arm/plat-mxc/include/mach/mxc_nand.h |    4 ++++
 drivers/mtd/nand/mxc_nand.c               |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/plat-mxc/include/mach/mxc_nand.h +0 -0
index 5d2d21d..a07bae9 100644
@@ -20,9 +20,13 @@
 #ifndef __ASM_ARCH_NAND_H

arch/arm/plat-mxc/include/mach/mxc_nand.h line 30

Quoted 10 lines
arch/arm/plat-mxc/include/mach/mxc_nand.h +4 -0
 #define __ASM_ARCH_NAND_H
 
+#include <linux/mtd/partitions.h>
+
 struct mxc_nand_platform_data {
 	int width;	/* data bus width in bytes */
 	int hw_ecc:1;	/* 0 if supress hardware ECC */
 	int flash_bbt:1; /* set to 1 to use a flash based bbt */
+	struct mtd_partition	*parts;	/* partition table */
+	int			nr_parts; /* size of parts */

Please don't use tab(s) between type and variable name. Use tabs to align the comment though. (Just like the other members of the struct do.)

Quoted 7 lines
arch/arm/plat-mxc/include/mach/mxc_nand.h +0 -0
 };
 #endif /* __ASM_ARCH_NAND_H */
drivers/mtd/nand/mxc_nand.c +0 -0
index b2900d8..4f615d2 100644

drivers/mtd/nand/mxc_nand.c static int __init mxcnd_probe(struct platform_device *pdev) · line 845

Quoted 8 lines
drivers/mtd/nand/mxc_nand.c +2 -0
@@ -838,6 +838,8 @@ static int __init mxcnd_probe(struct platform_device *pdev)
 	    parse_mtd_partitions(mtd, part_probes, &host->parts, 0);
 	if (nr_parts > 0)
 		add_mtd_partitions(mtd, host->parts, nr_parts);
+	else if (pdata->parts)
+		add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
 	else
 #endif
 	{

Cheers, Marc

Signature · 12 lines
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100527/625adc1f/attachment.sig>