[PATCH 1/2] mtd oob: do not register oob device for devices without oob
Sascha Hauer
s.hauer at pengutronix.de
Thu Nov 29 14:03:05 EST 2012
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
drivers/mtd/mtdoob.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c
index c7bf40c..e5d8039 100644
--- a/drivers/mtd/mtdoob.c
+++ b/drivers/mtd/mtdoob.c
@@ -73,6 +73,9 @@ static int add_mtdoob_device(struct mtd_info *mtd, char *devname, void **priv)
{
struct mtdoob *mtdoob;
+ if (mtd->oobsize == 0)
+ return 0;
+
mtdoob = xzalloc(sizeof(*mtdoob));
mtdoob->cdev.ops = &mtd_ops_oob;
mtdoob->cdev.size = (mtd->size / mtd->writesize) * mtd->oobsize;
--
1.7.10.4
More information about the barebox
mailing list