summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-10-02 13:52:47 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-10-08 11:14:48 +0200
commit8e322f9d7c99232531a7069783875355ef386e40 (patch)
tree28032c54c8b1b2984e84085bda903758c9a4c483 /drivers
parent55e61eaa636e31fea937495c8fb54e78cd1c804e (diff)
downloadbarebox-8e322f9d7c99232531a7069783875355ef386e40.tar.gz
barebox-8e322f9d7c99232531a7069783875355ef386e40.tar.xz
mtd: do not attach already attached UBI
in mtd_detect we do not check if the mtd is already attached to UBI. If it is we get the error: ERROR: ubi: mtd0 is already attached to ubi0 Check before trying to attach it to avoid this message. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/core.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index ae7818a189..15fe9ce798 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -589,11 +589,8 @@ static int mtd_detect(struct device_d *dev)
continue;
filetype = file_detect_type(buf, bufsize);
- if (filetype == filetype_ubi) {
+ if (filetype == filetype_ubi && ubi_num_get_by_mtd(mtd) < 0)
ret = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 20);
- if (ret == -EEXIST)
- ret = 0;
- }
break;
}