use a default VERSION field for kmod packages
[openwrt-10.03/.git] / package / switch / src / switch-core.c
index 6b59b9ba24a142129d46bcb5e3fc53775cd8eb75..5eeb803aa714614af6053f3aa9859fc5550fa5cf 100644 (file)
@@ -32,7 +32,7 @@
  *     ports: same syntax as for nvram's vlan*ports (eg. "1 2 3 4 5*")
  */
 
-#include <linux/config.h>
+#include <linux/autoconf.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <asm/uaccess.h>
@@ -64,8 +64,8 @@ static ssize_t switch_proc_read(struct file *file, char *buf, size_t count, loff
 static ssize_t switch_proc_write(struct file *file, const char *buf, size_t count, void *data);
 
 static struct file_operations switch_proc_fops = {
-       read: switch_proc_read,
-       write: switch_proc_write
+       .read = (ssize_t (*) (struct file *, char __user *, size_t, loff_t *))switch_proc_read,
+       .write = (ssize_t (*) (struct file *, const char __user *, size_t, loff_t *))switch_proc_write
 };
 
 static ssize_t switch_proc_read(struct file *file, char *buf, size_t count, loff_t *ppos)
@@ -100,6 +100,7 @@ static ssize_t switch_proc_read(struct file *file, char *buf, size_t count, loff
                len = 0;
        }
 
+       kfree(page);
        return len;
 }
 
@@ -436,7 +437,7 @@ void switch_unregister_driver(char *name) {
        }
 }
 
-static int __init switch_init()
+static int __init switch_init(void)
 {
        if ((switch_root = proc_mkdir("switch", NULL)) == NULL) {
                printk("%s: proc_mkdir failed.\n", __FILE__);
@@ -448,7 +449,7 @@ static int __init switch_init()
        return 0;
 }
 
-static void __exit switch_exit()
+static void __exit switch_exit(void)
 {
        remove_proc_entry("switch", NULL);
 }