2.4.0t9p6: drivers/char/toshiba.c: Use new /proc register/unregister

From: Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Date: Sun Sep 24 2000 - 16:56:07 EST


The following patch fixes registering/unregistering /proc/toshiba. This part
works, but on loading/unloading the module I get error messages. Machine is a
Satellite Pro 4280 XDVD, Red Hat 6.2, modutils-2.3.17. I assume the machine
has a different register layout than the one you use (older Toshiba patches/
modules didn't work either):

Sep 24 17:31:14 tigger kernel: io mapaddr 0xffffe not valid at toshiba.c:401!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffffa not valid at toshiba.c:401!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xfe6f5 not valid at toshiba.c:428!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xfe706 not valid at toshiba.c:430!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xf0039 not valid at toshiba.c:432!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xfe009 not valid at toshiba.c:479!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xfe00b not valid at toshiba.c:480!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xfe00c not valid at toshiba.c:480!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffff5 not valid at toshiba.c:485!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffff6 not valid at toshiba.c:485!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffff8 not valid at toshiba.c:486!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffff9 not valid at toshiba.c:486!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffffb not valid at toshiba.c:487!
Sep 24 17:31:14 tigger kernel: io mapaddr 0xffffc not valid at toshiba.c:487!
Sep 24 17:31:14 tigger kernel: Toshiba System Managment Mode driver v1.7 22/6/2000
Sep 24 17:32:03 tigger kernel: Trying to free nonexistent resource <0000-ffffffff>

--- linux-2.4.0-test/drivers/char/toshiba.c.dist-2.4.0-test9-pre6 Fri Sep 22 23:25:55 2000
+++ linux-2.4.0-test/drivers/char/toshiba.c Sun Sep 24 17:38:20 2000
@@ -5,6 +5,7 @@
  * Valuable assistance and patches from:
  * Tom May <tom@you-bastards.com>
  * Rob Napier <rnapier@employees.org>
+ * Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
  *
  * Fn status port numbers for machine ID's courtesy of
  * 0xfc08: Garth Berry <garth@itsbruce.net>
@@ -80,7 +81,7 @@
 MODULE_PARM(tosh_fn, "i");
 
 
-static int tosh_get_info(char *, char **, off_t, int, int);
+static int tosh_get_info(char *, char **, off_t, int);
 static int tosh_open(struct inode *ip, struct file *);
 static int tosh_release(struct inode *, struct file *);
 static int tosh_ioctl(struct inode *, struct file *, unsigned int,
@@ -100,9 +101,7 @@
         &tosh_fops
 };
 
-static struct proc_dir_entry tosh_proc_entry = {
- 0, 7, "toshiba", S_IFREG|S_IRUGO, 1, 0, 0, 33, NULL, tosh_get_info, NULL
-};
+static struct proc_dir_entry *tosh_proc_entry;
 
 /*
  * Read the Fn key status
@@ -338,7 +337,7 @@
 /*
  * Print the information for /proc/toshiba
  */
-int tosh_get_info(char *buffer, char **start, off_t fpos, int length, int dummy)
+int tosh_get_info(char *buffer, char **start, off_t fpos, int length)
 {
         char *temp;
         int key;
@@ -527,7 +526,12 @@
         misc_register(&tosh_device);
 
         /* register the proc entry */
- proc_register(&proc_root, &tosh_proc_entry);
+ tosh_proc_entry = create_proc_entry("toshiba", S_IFREG|S_IRUGO, NULL);
+ if(tosh_proc_entry)
+ tosh_proc_entry->get_info = tosh_get_info;
+ else
+ printk(KERN_ERR "toshiba: unable to register /proc/toshiba\n");
+
         return 0;
 }
 
@@ -540,7 +544,7 @@
 void cleanup_module(void)
 {
         /* remove the proc entry */
- proc_unregister(&proc_root, tosh_proc_entry.low_ino);
+ remove_proc_entry("toshiba", NULL);
 
         /* unregister the device file */
         misc_deregister(&tosh_device);

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Vin~a del Mar, Chile                               +56 32 672616

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:13 EST