aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2013-04-22 21:40:16 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2013-05-16 05:37:31 -0400
commit1557b9e1cb669f90696c863fbf525a1033022c10 (patch)
treec8efe722765d1db7dc3e97a452fe1633d1292a04 /drivers/mtd
parent6fde0f307cdc3cdf7a11a13c5335e11627f9ef24 (diff)
UBI: do not abort init when ubi.mtd devices cannot be found
The current ubi.mtd parsing logic will warn & continue on when attaching the specified mtd device fails (for any reason). It doesn't however skip things when the specified mtd device can't be opened. This scenario can be hit in a couple of different ways such as: - build NAND controller driver as a module - build UBI into the kernel - include ubi.mtd on the kernel command line - boot the system - MTD devices don't exist, so UBI init fails This is problematic because failing init means the entire UBI layer is unavailable until you reboot and modify the kernel command line. If we just warn and continue on, /dev/ubi_ctrl is available for userland to add UBI volumes on the fly once it loads the NAND driver. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/build.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 745fbc574141..8ff08ecb9383 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -1261,7 +1261,11 @@ static int __init ubi_init(void)
1261 mtd = open_mtd_device(p->name); 1261 mtd = open_mtd_device(p->name);
1262 if (IS_ERR(mtd)) { 1262 if (IS_ERR(mtd)) {
1263 err = PTR_ERR(mtd); 1263 err = PTR_ERR(mtd);
1264 goto out_detach; 1264 ubi_err("cannot open mtd %s, error %d", p->name, err);
1265 /* See comment below re-ubi_is_module(). */
1266 if (ubi_is_module())
1267 goto out_detach;
1268 continue;
1265 } 1269 }
1266 1270
1267 mutex_lock(&ubi_devices_mutex); 1271 mutex_lock(&ubi_devices_mutex);