patch-1.3.33 linux/drivers/char/stallion.c

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

diff -u --recursive --new-file v1.3.32/linux/drivers/char/stallion.c linux/drivers/char/stallion.c
@@ -438,16 +438,6 @@
 /*****************************************************************************/
 
 /*
- *	Memory allocation vars. These keep track of what memory allocation
- *	we can currently use. They help deal with memory in a consistent
- *	way, whether during init or run-time.
- */
-static int	stl_meminited = 0;
-static long	stl_memend;
-
-/*****************************************************************************/
-
-/*
  *	Define some handy local macros...
  */
 #ifndef	MIN
@@ -463,13 +453,10 @@
 #ifdef MODULE
 int		init_module(void);
 void		cleanup_module(void);
-#else
-static void	stl_meminit(long base);
-static long	stl_memhalt(void);
 #endif
 static void	*stl_memalloc(int len);
 
-long		stl_init(long kmem_start);
+int		stl_init(void);
 static int	stl_open(struct tty_struct *tty, struct file *filp);
 static void	stl_close(struct tty_struct *tty, struct file *filp);
 static int	stl_write(struct tty_struct *tty, int from_user, const unsigned char *buf, int count);
@@ -533,7 +520,7 @@
 
 	save_flags(flags);
 	cli();
-	stl_init(0);
+	stl_init();
 	restore_flags(flags);
 
 	return(0);
@@ -628,33 +615,9 @@
  *	memory and it will do the right thing.
  */
 
-#ifndef MODULE
-
-static void stl_meminit(long base)
-{
-	stl_memend = base;
-	stl_meminited = 1;
-}
-
-static long stl_memhalt()
-{
-	stl_meminited = 0;
-	return(stl_memend);
-}
-
-#endif
-
 static void *stl_memalloc(int len)
 {
-	void	*mem;
-
-	if (stl_meminited) {
-		mem = (void *) stl_memend;
-		stl_memend += len;
-	} else {
-		mem = (void *) kmalloc(len, GFP_KERNEL);
-	}
-	return(mem);
+	return (void *) kmalloc(len, GFP_KERNEL);
 }
 
 /*****************************************************************************/
@@ -2902,14 +2865,10 @@
 
 /*****************************************************************************/
 
-long stl_init(long kmem_start)
+int stl_init(void)
 {
 	printk("%s: version %s\n", stl_drvname, stl_drvversion);
 
-#ifndef	MODULE
-	stl_meminit(kmem_start);
-#endif
-
 	stl_initbrds();
 
 /*
@@ -2964,10 +2923,7 @@
 	if (tty_register_driver(&stl_callout))
 		printk("STALLION: failed to register callout driver\n");
 
-#ifndef	MODULE
-	kmem_start = stl_memhalt();
-#endif
-	return(kmem_start);
+	return 0;
 }
 
 /*****************************************************************************/

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this