]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
mtd, ubi, ubifs: update for the sync with linux v3.14
authorHeiko Schocher <hs@denx.de>
Tue, 15 Jul 2014 14:08:42 +0000 (16:08 +0200)
committerTom Rini <trini@ti.com>
Mon, 25 Aug 2014 23:25:56 +0000 (19:25 -0400)
while playing with the new mtd/ubi/ubifs sync, found some
small updates for it:

- add del_mtd_partition() to include/linux/mtd/mtd
- mtd: add a debug_printf
- remove some not used functions

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Tom Rini <trini@ti.com>
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c
fs/ubifs/super.c
include/linux/mtd/mtd.h

index 796ac0729e3a3f84545736f09f849ae18f7d0984..bdb94ce5add57d97fda0c516b0f41cc85c04ed69 100644 (file)
@@ -476,6 +476,8 @@ int add_mtd_device(struct mtd_info *mtd)
           the notifier, since we hold the mtd_table_mutex */
        list_for_each_entry(not, &mtd_notifiers, list)
                not->add(mtd);
+#else
+       pr_debug("mtd: Giving out device %d to %s\n", i, mtd->name);
 #endif
 
        mutex_unlock(&mtd_table_mutex);
index d20b8578e7644ce1cba2323ae489c6c4db7d3206..3dc47b3c0edb8185c6212fe59ff26467d79d2c8b 100644 (file)
@@ -572,6 +572,7 @@ out_register:
        return slave;
 }
 
+#ifndef __UBOOT__
 int mtd_add_partition(struct mtd_info *master, const char *name,
                      long long offset, long long length)
 {
@@ -651,6 +652,7 @@ int mtd_del_partition(struct mtd_info *master, int partno)
        return ret;
 }
 EXPORT_SYMBOL_GPL(mtd_del_partition);
+#endif
 
 /*
  * This function, given a master MTD object and a partition table, creates
index 9c87db40d3838c4dd271460884b4c293c3f4e14e..5f536914283c496dc34c7c540d5287ec14ada37b 100644 (file)
@@ -2241,8 +2241,14 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent)
        int err;
 
        c->vfs_sb = sb;
+#ifndef __UBOOT__
        /* Re-open the UBI device in read-write mode */
        c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READWRITE);
+#else
+       /* U-Boot read only mode */
+       c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
+#endif
+
        if (IS_ERR(c->ubi)) {
                err = PTR_ERR(c->ubi);
                goto out;
index b7b47570ea57e49075701566942cd1057bbdab8e..e6cfd559eb5360ea8dbbd2cd8d1515c98aba7a1c 100644 (file)
@@ -480,6 +480,7 @@ static inline int mtd_is_bitflip_or_eccerr(int err) {
 #ifdef __UBOOT__
 /* drivers/mtd/mtdcore.h */
 int add_mtd_device(struct mtd_info *mtd);
+int del_mtd_device(struct mtd_info *mtd);
 int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int);
 int del_mtd_partitions(struct mtd_info *);
 #endif