]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ENGR00279980 ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1
authorHuang Shijie <b32955@freescale.com>
Wed, 18 Sep 2013 02:17:39 +0000 (10:17 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:07:15 +0000 (18:07 +0200)
commitaeb5987b7b5ab116d8dea571de3f914526e6c836
treefa2c813d85949de3a2f09ab2ed8d004e7318addb
parent58ddfbb1a940535926b09d7a4fea6f6db2fd15bf
ENGR00279980 ubi: attach: do not return -EINVAL if the mtd->numeraseregions is 1

If the master mtd does not have any slave mtd partitions,
and its numeraseregions is one(only has one erease block), and
we attach the master mtd with : ubiattach -m 0 -d 0

We will meet the error:
-------------------------------------------------------
root@freescale ~$ ubiattach /dev/ubi_ctrl -m 0 -d 0
UBI: attaching mtd0 to ubi0
UBI error: io_init: multiple regions, not implemented
ubiattach: error!: cannot attach mtd0
           error 22 (Invalid argument)
-------------------------------------------------------

In fact, if there is only one "erase block", we should not
prevent the attach.

This patch fixes it.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/ubi/build.c