summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-12-13 00:20:01 +0100
committerWolfgang Denk <wd@denx.de>2008-12-13 00:20:01 +0100
commitbd4345c175116df4a392f05c9f41679c545842d5 (patch)
treed5f06efbf4882ae8fb920827d3bc66c9b50297d7 /drivers
parent2145188bea2df8f2b47a87ec3071b55027e8d0ae (diff)
parent3b089e4f889a2902449d55e081c886ae607cae89 (diff)
Merge branch 'master' of git://git.denx.de/u-boot-ubi
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/mtdpart.c10
-rw-r--r--drivers/mtd/ubi/build.c6
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 9a3bf6f39d..f010f5e3ac 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -20,7 +20,7 @@
#include <linux/mtd/compat.h>
/* Our partition linked list */
-static LIST_HEAD(mtd_partitions);
+struct list_head mtd_partitions;
/* Our partition node structure */
struct mtd_part {
@@ -349,6 +349,14 @@ int add_mtd_partitions(struct mtd_info *master,
u_int32_t cur_offset = 0;
int i;
+ /*
+ * Need to init the list here, since LIST_INIT() does not
+ * work on platforms where relocation has problems (like MIPS
+ * & PPC).
+ */
+ if (mtd_partitions.next == NULL)
+ INIT_LIST_HEAD(&mtd_partitions);
+
printk (KERN_NOTICE "Creating %d MTD partitions on \"%s\":\n", nbparts, master->name);
for (i = 0; i < nbparts; i++) {
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 17cabb2ae9..f4b01a9ded 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -784,19 +784,20 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, int vid_hdr_offset)
if (err)
goto out_free;
+ err = -ENOMEM;
ubi->peb_buf1 = vmalloc(ubi->peb_size);
if (!ubi->peb_buf1)
goto out_free;
ubi->peb_buf2 = vmalloc(ubi->peb_size);
if (!ubi->peb_buf2)
- goto out_free;
+ goto out_free;
#ifdef CONFIG_MTD_UBI_DEBUG
mutex_init(&ubi->dbg_buf_mutex);
ubi->dbg_peb_buf = vmalloc(ubi->peb_size);
if (!ubi->dbg_peb_buf)
- goto out_free;
+ goto out_free;
#endif
err = attach_by_scanning(ubi);
@@ -1059,6 +1060,7 @@ void __exit ubi_exit(void)
misc_deregister(&ubi_ctrl_cdev);
class_remove_file(ubi_class, &ubi_version);
class_destroy(ubi_class);
+ mtd_devs = 0;
}
module_exit(ubi_exit);