9
0
Fork 0

mtd: mtdraw: Do not create for partitions and devices without oob

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

View File

@ -285,6 +285,9 @@ static int add_mtdraw_device(struct mtd_info *mtd, char *devname, void **priv)
{
struct mtdraw *mtdraw;
if (mtd->master || mtd->oobsize == 0)
return 0;
mtdraw = xzalloc(sizeof(*mtdraw));
mtdraw->writebuf = xmalloc(RAW_WRITEBUF_SIZE);
mtdraw->mtd = mtd;
@ -306,6 +309,9 @@ static int del_mtdraw_device(struct mtd_info *mtd, void **priv)
{
struct mtdraw *mtdraw;
if (mtd->master || mtd->oobsize == 0)
return 0;
mtdraw = *priv;
devfs_remove(&mtdraw->cdev);
free(mtdraw);