diff options
Diffstat (limited to 'drivers/mtd/onenand/onenand_uboot.c')
-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 4541b22..a95b922 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 } |