9
0
Fork 0

mtd: mtdoob: Do not create for partitions

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-02-13 14:28:53 +01:00
parent 05e4864f6b
commit d5e38fc913
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,7 @@ static int add_mtdoob_device(struct mtd_info *mtd, char *devname, void **priv)
{
struct mtdoob *mtdoob;
if (mtd->oobsize == 0)
if (mtd->master || mtd->oobsize == 0)
return 0;
mtdoob = xzalloc(sizeof(*mtdoob));
@ -93,6 +93,9 @@ static int del_mtdoob_device(struct mtd_info *mtd, void **priv)
{
struct mtdoob *mtdoob;
if (mtd->master || mtd->oobsize == 0)
return 0;
mtdoob = *priv;
devfs_remove(&mtdoob->cdev);
free(mtdoob);