patch-2.3.47 linux/drivers/char/joystick/joystick.c

Next file: linux/drivers/char/lp.c
Previous file: linux/drivers/char/h8.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/drivers/char/joystick/joystick.c linux/drivers/char/joystick/joystick.c
@@ -738,12 +738,6 @@
 
 	curd->name = all += axes * sizeof(struct js_corr);
 	strcpy(curd->name, name);
-	sprintf (devfs_name, "analogue%d", number);
-	curd->devfs_handle = devfs_register (devfs_handle, devfs_name, 0,
-					     DEVFS_FL_DEFAULT,
-					     JOYSTICK_MAJOR, number,
-					     S_IFCHR | S_IRUGO | S_IWUSR, 0, 0,
-					     &js_fops, NULL);
 
 	port->devs[number] = curd;
 	port->axes[number] = curd->new.axes;
@@ -757,6 +751,13 @@
 
 	spin_unlock_irqrestore(&js_lock, flags);	
 
+	sprintf(devfs_name, "js%d", i);
+	curd->devfs_handle = devfs_register(devfs_handle, devfs_name, 0,
+					    DEVFS_FL_DEFAULT,
+					    JOYSTICK_MAJOR, i,
+					    S_IFCHR | S_IRUGO | S_IWUSR, 0, 0,
+					    &js_fops, NULL);
+
 	return i;
 }
 
@@ -772,7 +773,7 @@
 
 	spin_unlock_irqrestore(&js_lock, flags);	
 
-	devfs_unregister (dev->devfs_handle);
+	devfs_unregister(dev->devfs_handle);
 	kfree(dev);
 }
 
@@ -805,7 +806,7 @@
 		printk(KERN_ERR "js: unable to get major %d for joystick\n", JOYSTICK_MAJOR);
 		return -EBUSY;
 	}
-	devfs_handle = devfs_mk_dir (NULL, "joysticks", 9, NULL);
+	devfs_handle = devfs_mk_dir(NULL, "joysticks", 9, NULL);
 
 	printk(KERN_INFO "js: Joystick driver v%d.%d.%d (c) 1999 Vojtech Pavlik <vojtech@suse.cz>\n",
 		JS_VERSION >> 16 & 0xff, JS_VERSION >> 8 & 0xff, JS_VERSION & 0xff);
@@ -885,9 +886,9 @@
 void cleanup_module(void)
 {
 	del_timer(&js_timer);
-	devfs_unregister (devfs_handle);
+	devfs_unregister(devfs_handle);
 	if (devfs_unregister_chrdev(JOYSTICK_MAJOR, "js"))
-	printk(KERN_ERR "js: can't unregister device\n");
+		printk(KERN_ERR "js: can't unregister device\n");
 }
 #endif
 

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