]> 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)
committerAllen Xu <b45815@freescale.com>
Fri, 30 Jan 2015 19:40:08 +0000 (03:40 +0800)
commit9dab0f9f13bacf3fed30eb79e188be313b89e787
tree01db838cf636e3ec78e2140f03123ca2fc641f2a
parent61f5ff47358e4c1c31fbed3ccbce722d216ee429
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>
(cherry picked from commit 361cdc47fc4c4db31c5485560cdabd94f409bd81)
drivers/mtd/ubi/build.c