mtd: mtdoob: Do not create for partitions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
05e4864f6b
commit
d5e38fc913
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue