diff options
author | Stefan Roese <sr@denx.de> | 2009-04-24 17:59:35 +0400 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2009-04-28 03:15:38 +0400 |
commit | dbe29e36a4c2775b69b5a63b0ce2bac89c08e691 (patch) | |
tree | da7930d4f212f88a2a9e3ede33873869f75bea16 /drivers/mtd/onenand | |
parent | 10bb62d85a0850dbad1fdd34123378686373f166 (diff) | |
download | u-boot-dbe29e36a4c2775b69b5a63b0ce2bac89c08e691.tar.xz |
mtd: nand/onenand: Register mtd device upon device scanning
With this patch the NAND and OneNAND devices are registered in the MTD
subsystem and can then be referenced by the mtdcore code (e.g.
get_mtd_device_nm()). This is needed for the new "ubi part" command
syntax without the flash type parameter (nor|nand|onenand).
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/mtd/onenand')
-rw-r--r-- | drivers/mtd/onenand/onenand_uboot.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/onenand/onenand_uboot.c b/drivers/mtd/onenand/onenand_uboot.c index 4541b22177..a95b922a8f 100644 --- a/drivers/mtd/onenand/onenand_uboot.c +++ b/drivers/mtd/onenand/onenand_uboot.c @@ -20,6 +20,7 @@ struct mtd_info onenand_mtd; struct onenand_chip onenand_chip; +static __attribute__((unused)) char dev_name[] = "onenand0"; void onenand_init(void) { @@ -41,4 +42,13 @@ void onenand_init(void) puts("OneNAND: "); print_size(onenand_mtd.size, "\n"); + +#ifdef CONFIG_MTD_PARTITIONS + /* + * Add MTD device so that we can reference it later + * via the mtdcore infrastructure (e.g. ubi). + */ + onenand_mtd.name = dev_name; + add_mtd_device(&onenand_mtd); +#endif } |