Commit 0b88527b authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] acsi_slm cleanup

	switched to explicit devfs_register()/devfs_remove()
parent 356df99b
...@@ -993,11 +993,10 @@ int attach_slm( int target, int lun ) ...@@ -993,11 +993,10 @@ int attach_slm( int target, int lun )
return( 1 ); return( 1 );
} }
static devfs_handle_t devfs_handle;
int slm_init( void ) int slm_init( void )
{ {
int i;
if (register_chrdev( MAJOR_NR, "slm", &slm_fops )) { if (register_chrdev( MAJOR_NR, "slm", &slm_fops )) {
printk( KERN_ERR "Unable to get major %d for ACSI SLM\n", MAJOR_NR ); printk( KERN_ERR "Unable to get major %d for ACSI SLM\n", MAJOR_NR );
return -EBUSY; return -EBUSY;
...@@ -1011,10 +1010,14 @@ int slm_init( void ) ...@@ -1011,10 +1010,14 @@ int slm_init( void )
BufferP = SLMBuffer; BufferP = SLMBuffer;
SLMState = IDLE; SLMState = IDLE;
devfs_handle = devfs_mk_dir (NULL, "slm", NULL); devfs_mk_dir (NULL, "slm", NULL);
devfs_register_series (devfs_handle, "%u", MAX_SLM, DEVFS_FL_DEFAULT, for (i = 0; i < MAX_SLM; i++) {
MAJOR_NR, 0, S_IFCHR | S_IRUSR | S_IWUSR, char name[16];
sprintf(name, "slm/%d", i);
devfs_register(NULL, name, DEVFS_FL_DEFAULT,
MAJOR_NR, i, S_IFCHR | S_IRUSR | S_IWUSR,
&slm_fops, NULL); &slm_fops, NULL);
}
return 0; return 0;
} }
...@@ -1037,7 +1040,10 @@ int init_module(void) ...@@ -1037,7 +1040,10 @@ int init_module(void)
void cleanup_module(void) void cleanup_module(void)
{ {
devfs_unregister (devfs_handle); int i;
for (i = 0; i < MAX_SLM; i++)
devfs_remove("slm/%d", i);
devfs_remove("slm");
if (unregister_chrdev( MAJOR_NR, "slm" ) != 0) if (unregister_chrdev( MAJOR_NR, "slm" ) != 0)
printk( KERN_ERR "acsi_slm: cleanup_module failed\n"); printk( KERN_ERR "acsi_slm: cleanup_module failed\n");
atari_stram_free( SLMBuffer ); atari_stram_free( SLMBuffer );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment