patch-2.4.3 linux/drivers/char/dsp56k.c

Next file: linux/drivers/char/dz.c
Previous file: linux/drivers/char/drm/radeon_bufs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/char/dsp56k.c linux/drivers/char/dsp56k.c
@@ -265,7 +265,7 @@
 	}
 
 	default:
-		printk("DSP56k driver: Unknown minor device: %d\n", dev);
+		printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
 		return -ENXIO;
 	}
 }
@@ -327,7 +327,7 @@
 		return -EFAULT;
 	}
 	default:
-		printk("DSP56k driver: Unknown minor device: %d\n", dev);
+		printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
 		return -ENXIO;
 	}
 }
@@ -416,7 +416,7 @@
 		return 0;
 
 	default:
-		printk("DSP56k driver: Unknown minor device: %d\n", dev);
+		printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
 		return -ENXIO;
 	}
 }
@@ -469,7 +469,7 @@
 		break;
 
 	default:
-		printk("DSP56k driver: Unknown minor device: %d\n", dev);
+		printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
 		return -ENXIO;
 	}
 
@@ -490,7 +490,7 @@
 
 		break;
 	default:
-		printk("DSP56k driver: Unknown minor device: %d\n", dev);
+		printk(KERN_ERR "DSP56k driver: Unknown minor device: %d\n", dev);
 		return -ENXIO;
 	}
 
@@ -511,7 +511,9 @@
 
 static devfs_handle_t devfs_handle;
 
-int __init dsp56k_init(void)
+static const char banner[] __initdata = KERN_INFO "DSP56k driver installed\n";
+
+static int __init dsp56k_init_driver(void)
 {
 	if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) {
 		printk("DSP56k driver: Hardware not present\n");
@@ -522,27 +524,19 @@
 		printk("DSP56k driver: Unable to register driver\n");
 		return -ENODEV;
 	}
-	devfs_handle = devfs_register (NULL, "dsp56k", DEVFS_FL_DEFAULT,
-				       DSP56K_MAJOR, 0,
-				       S_IFCHR | S_IRUSR | S_IWUSR,
-				       &dsp56k_fops, NULL);
-
-	dsp56k.in_use = 0;
-
-	printk("DSP56k driver installed\n");
+	devfs_handle = devfs_register(NULL, "dsp56k", DEVFS_FL_DEFAULT,
+				      DSP56K_MAJOR, 0,
+				      S_IFCHR | S_IRUSR | S_IWUSR,
+				      &dsp56k_fops, NULL);
 
+	printk(banner);
 	return 0;
 }
+module_init(dsp56k_init_driver);
 
-#ifdef MODULE
-int init_module(void)
-{
-	return dsp56k_init();
-}
-
-void cleanup_module(void)
+static void __exit dsp56k_cleanup_driver(void)
 {
 	devfs_unregister_chrdev(DSP56K_MAJOR, "dsp56k");
-	devfs_unregister (devfs_handle);
+	devfs_unregister(devfs_handle);
 }
-#endif /* MODULE */
+module_exit(dsp56k_cleanup_driver);

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