mtd/drivers/mtd mtdchar.c,1.71,1.72

tpoynor at infradead.org tpoynor at infradead.org
Wed Jun 29 20:23:27 EDT 2005


Update of /home/cvs/mtd/drivers/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv13926/drivers/mtd

Modified Files:
	mtdchar.c 
Log Message:
Convert mtdchar class_simple usage to new class API.

Signed-off-by: Todd Poynor <tpoynor at mvista.com>


Index: mtdchar.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdchar.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- mtdchar.c	14 Jun 2005 19:11:15 -0000	1.71
+++ mtdchar.c	30 Jun 2005 00:23:24 -0000	1.72
@@ -17,19 +17,19 @@
 
 #include <linux/device.h>
 
-static struct class_simple *mtd_class;
+static struct class *mtd_class;
 
 static void mtd_notify_add(struct mtd_info* mtd)
 {
 	if (!mtd)
 		return;
 
-	class_simple_device_add(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
-				NULL, "mtd%d", mtd->index);
-
-	class_simple_device_add(mtd_class, 
-				MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
-				NULL, "mtd%dro", mtd->index);
+	class_device_create(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
+			    NULL, "mtd%d", mtd->index);
+	
+	class_device_create(mtd_class, 
+			    MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
+			    NULL, "mtd%dro", mtd->index);
 }
 
 static void mtd_notify_remove(struct mtd_info* mtd)
@@ -37,8 +37,8 @@
 	if (!mtd)
 		return;
 
-	class_simple_device_remove(MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
-	class_simple_device_remove(MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
+	class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2));
+	class_device_destroy(mtd_class, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1));
 }
 
 static struct mtd_notifier notifier = {
@@ -644,7 +644,7 @@
 		return -EAGAIN;
 	}
 
-	mtd_class = class_simple_create(THIS_MODULE, "mtd");
+	mtd_class = class_create(THIS_MODULE, "mtd");
 
 	if (IS_ERR(mtd_class)) {
 		printk(KERN_ERR "Error creating mtd class.\n");
@@ -659,7 +659,7 @@
 static void __exit cleanup_mtdchar(void)
 {
 	unregister_mtd_user(&notifier);
-	class_simple_destroy(mtd_class);
+	class_destroy(mtd_class);
 	unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
 }
 





More information about the linux-mtd-cvs mailing list