mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* more mtd
@ 2014-02-13 18:48 Sascha Hauer
  2014-02-13 18:48 ` [PATCH 1/2] mtd: mtdraw: Do not create for partitions and devices without oob Sascha Hauer
  2014-02-13 18:48 ` [PATCH 2/2] mtd: mtdoob: Do not create for partitions Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2014-02-13 18:48 UTC (permalink / raw)
  To: barebox

Two small additions to the last series. This makes sure that the mtd
oob and mtd raw devices are only registered on mtds which actually
have oob.

Sascha

----------------------------------------------------------------
Sascha Hauer (2):
      mtd: mtdraw: Do not create for partitions and devices without oob
      mtd: mtdoob: Do not create for partitions

 drivers/mtd/mtdoob.c | 5 ++++-
 drivers/mtd/mtdraw.c | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] mtd: mtdraw: Do not create for partitions and devices without oob
  2014-02-13 18:48 more mtd Sascha Hauer
@ 2014-02-13 18:48 ` Sascha Hauer
  2014-02-13 18:48 ` [PATCH 2/2] mtd: mtdoob: Do not create for partitions Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2014-02-13 18:48 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/mtdraw.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mtd/mtdraw.c b/drivers/mtd/mtdraw.c
index be34723..006b28f 100644
--- a/drivers/mtd/mtdraw.c
+++ b/drivers/mtd/mtdraw.c
@@ -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);
-- 
1.8.5.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] mtd: mtdoob: Do not create for partitions
  2014-02-13 18:48 more mtd Sascha Hauer
  2014-02-13 18:48 ` [PATCH 1/2] mtd: mtdraw: Do not create for partitions and devices without oob Sascha Hauer
@ 2014-02-13 18:48 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2014-02-13 18:48 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mtd/mtdoob.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdoob.c b/drivers/mtd/mtdoob.c
index 1e88b53..b9cac2a 100644
--- a/drivers/mtd/mtdoob.c
+++ b/drivers/mtd/mtdoob.c
@@ -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);
-- 
1.8.5.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-13 18:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-13 18:48 more mtd Sascha Hauer
2014-02-13 18:48 ` [PATCH 1/2] mtd: mtdraw: Do not create for partitions and devices without oob Sascha Hauer
2014-02-13 18:48 ` [PATCH 2/2] mtd: mtdoob: Do not create for partitions Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox