patch-2.4.19 linux-2.4.19/drivers/char/misc.c

Next file: linux-2.4.19/drivers/char/mk712.c
Previous file: linux-2.4.19/drivers/char/mem.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/char/misc.c linux-2.4.19/drivers/char/misc.c
@@ -76,6 +76,7 @@
 extern int pmu_device_init(void);
 extern int tosh_init(void);
 extern int i8k_init(void);
+extern int lcd_init(void);
 
 static int misc_read_proc(char *buf, char **start, off_t offset,
 			  int len, int *eof, void *private)
@@ -170,7 +171,7 @@
  
 int misc_register(struct miscdevice * misc)
 {
-	static devfs_handle_t devfs_handle;
+	static devfs_handle_t devfs_handle, dir;
 	struct miscdevice *c;
 	
 	if (misc->next || misc->prev)
@@ -201,11 +202,12 @@
 		misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
 	if (!devfs_handle)
 		devfs_handle = devfs_mk_dir (NULL, "misc", NULL);
+	dir = strchr (misc->name, '/') ? NULL : devfs_handle;
 	misc->devfs_handle =
-	    devfs_register (devfs_handle, misc->name, DEVFS_FL_NONE,
-			    MISC_MAJOR, misc->minor,
-			    S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,
-			    misc->fops, NULL);
+		devfs_register (dir, misc->name, DEVFS_FL_NONE,
+				MISC_MAJOR, misc->minor,
+				S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP,
+				misc->fops, NULL);
 
 	/*
 	 * Add it to the front, so that later devices can "override"
@@ -277,6 +279,9 @@
 #ifdef CONFIG_TOSHIBA
 	tosh_init();
 #endif
+#ifdef CONFIG_COBALT_LCD
+	lcd_init();
+#endif
 #ifdef CONFIG_I8K
 	i8k_init();
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)