From fa6d85a1361a555467e60d0b4bc8170d08fb13a0 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Wed, 5 May 2010 10:17:25 +0200 Subject: [PATCH] --- yaml --- r: 195830 b: refs/heads/master c: af7ad7a0a6c0c1d8497a25b6b8b3b2ce9f52ff04 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mtd/ubi/build.c | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index af5c76f174e2..8c068cc6c4cc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 70d38b9625edba52a809308427f78831c3963f52 +refs/heads/master: af7ad7a0a6c0c1d8497a25b6b8b3b2ce9f52ff04 diff --git a/trunk/drivers/mtd/ubi/build.c b/trunk/drivers/mtd/ubi/build.c index 3a59a1d0045e..13b05cb33b08 100644 --- a/trunk/drivers/mtd/ubi/build.c +++ b/trunk/drivers/mtd/ubi/build.c @@ -49,6 +49,12 @@ /* Maximum length of the 'mtd=' parameter */ #define MTD_PARAM_LEN_MAX 64 +#ifdef CONFIG_MTD_UBI_MODULE +#define ubi_is_module() 1 +#else +#define ubi_is_module() 0 +#endif + /** * struct mtd_dev_param - MTD device parameter description data structure. * @name: MTD character device node path, MTD device name, or MTD device number @@ -1206,9 +1212,24 @@ static int __init ubi_init(void) p->vid_hdr_offs); mutex_unlock(&ubi_devices_mutex); if (err < 0) { - put_mtd_device(mtd); ubi_err("cannot attach mtd%d", mtd->index); - goto out_detach; + put_mtd_device(mtd); + + /* + * Originally UBI stopped initializing on any error. + * However, later on it was found out that this + * behavior is not very good when UBI is compiled into + * the kernel and the MTD devices to attach are passed + * through the command line. Indeed, UBI failure + * stopped whole boot sequence. + * + * To fix this, we changed the behavior for the + * non-module case, but preserved the old behavior for + * the module case, just for compatibility. This is a + * little inconsistent, though. + */ + if (ubi_is_module()) + goto out_detach; } }