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:
parent
9c66af7b0e
commit
05e4864f6b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue