[PATCH V2 5/8] drivers/mtd: fix core multiple MTD registrations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If multiple MTD devices were registered, an exception
occured, as they all wanted id 0. Let the driver code choose
the device number dynamically.

Signed-off-by: Robert Jarzmik <robert.jarzmik@xxxxxxx>
---
 drivers/mtd/core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index 9029474..49a2dfa 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -254,6 +254,7 @@ int add_mtd_device(struct mtd_info *mtd, char *devname)
 	if (!devname)
 		devname = "mtd";
 	strcpy(mtd->class_dev.name, devname);
+	mtd->class_dev.id = -1;
 	register_device(&mtd->class_dev);
 
 	mtd->cdev.ops = &mtd_ops;
-- 
1.7.5.4


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


[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux