patch-1.3.39 linux/drivers/cdrom/sjcd.c

Next file: linux/drivers/cdrom/sonycd535.c
Previous file: linux/drivers/cdrom/sbpcd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/sjcd.c linux/drivers/cdrom/sjcd.c
@@ -51,17 +51,7 @@
  *
  */
 
-#include <linux/major.h>
-#include <linux/config.h>
-
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#define sjcd_init init_module
-#ifndef CONFIG_MODVERSIONS
-char kernel_version[]= UTS_RELEASE;
-#endif
-#endif
 
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -72,6 +62,7 @@
 #include <linux/cdrom.h>
 #include <linux/ioport.h>
 #include <linux/string.h>
+#include <linux/major.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -1440,9 +1431,7 @@
     printk( "sjcd: open: done\n" );
 #endif
   }
-#ifdef MODULE
   MOD_INC_USE_COUNT;
-#endif
   ++sjcd_open_count;
   return( 0 );
 }
@@ -1456,9 +1445,7 @@
 #if defined( SJCD_TRACE )
   printk( "sjcd: release\n" );
 #endif
-#ifdef MODULE
   MOD_DEC_USE_COUNT;
-#endif
   if( --sjcd_open_count == 0 ){
     sjcd_invalidate_buffers();
     sync_dev( inode->i_rdev );
@@ -1632,10 +1619,14 @@
 }
 
 #ifdef MODULE
+
+int init_module(void)
+{
+	return sjcd_init();
+}
+
 void cleanup_module( void ){
-  if( MOD_IN_USE ){
-    printk( "sjcd: module: in use - can not remove.\n" );
-  } else if( ( unregister_blkdev( MAJOR_NR, "sjcd" ) == -EINVAL ) ){
+  if( ( unregister_blkdev( MAJOR_NR, "sjcd" ) == -EINVAL ) ){
     printk( "sjcd: module: can not unregister device.\n" );
   } else {
     release_region( sjcd_port, 4 );

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