Commit 39211e86 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] cdrom cleanup

	switched to devfs_remove(), killed gratitious devfs_handle_t variables.
parent fb5d30ed
......@@ -1907,16 +1907,14 @@ static int __init aztcd_init(void)
goto err_out;
}
}
devfs_register(NULL, "aztcd", DEVFS_FL_DEFAULT, MAJOR_NR, 0,
S_IFBLK | S_IRUGO | S_IWUGO, &azt_fops, NULL);
azt_disk = alloc_disk(1);
if (!azt_disk)
goto err_out2;
goto err_out;
if (register_blkdev(MAJOR_NR, "aztcd", &azt_fops) != 0) {
printk(KERN_WARNING "aztcd: Unable to get major %d for Aztech"
" CD-ROM\n", MAJOR_NR);
ret = -EIO;
goto err_out3;
goto err_out2;
}
blk_init_queue(&azt_queue, do_aztcd_request, &aztSpin);
blk_queue_hardsect_size(&azt_queue, 2048);
......@@ -1926,15 +1924,16 @@ static int __init aztcd_init(void)
sprintf(azt_disk->disk_name, "aztcd");
azt_disk->queue = &azt_queue;
add_disk(azt_disk);
devfs_register(NULL, "aztcd", DEVFS_FL_DEFAULT,
azt_disk->major, azt_disk->first_minor,
S_IFBLK | S_IRUGO | S_IWUGO, azt_disk->fops, NULL);
azt_invalidate_buffers();
aztPresent = 1;
aztCloseDoor();
return (0);
err_out3:
put_disk(azt_disk);
err_out2:
devfs_remove("aztcd");
put_disk(azt_disk);
err_out:
if ((azt_port == 0x1f0) || (azt_port == 0x170)) {
SWITCH_IDE_MASTER;
......
......@@ -5637,8 +5637,6 @@ static int __init config_spea(void)
* Called once at boot or load time.
*/
static devfs_handle_t devfs_handle;
/* FIXME: cleanups after failed allocations are too ugly for words */
#ifdef MODULE
int __init __sbpcd_init(void)
......@@ -5808,7 +5806,7 @@ int __init sbpcd_init(void)
}
blk_init_queue(&sbpcd_queue, do_sbpcd_request, &sbpcd_lock);
devfs_handle = devfs_mk_dir (NULL, "sbp", NULL);
devfs_mk_dir (NULL, "sbp", NULL);
for (j=0;j<NR_SBPCD;j++)
{
......@@ -5902,12 +5900,12 @@ void sbpcd_exit(void)
}
release_region(CDo_command,4);
blk_cleanup_queue(&sbpcd_queue);
devfs_unregister (devfs_handle);
for (j=0;j<NR_SBPCD;j++)
{
if (D_S[j].drv_id==-1) continue;
del_gendisk(D_S[j].disk);
put_disk(D_S[j].disk);
devfs_remove("sbp/c0t%d", j);
vfree(D_S[j].sbp_buf);
if (D_S[j].sbp_audsiz>0) vfree(D_S[j].aud_buf);
if ((unregister_cdrom(D_S[j].sbpcd_infop) == -EINVAL))
......@@ -5917,6 +5915,7 @@ void sbpcd_exit(void)
}
vfree(D_S[j].sbpcd_infop);
}
devfs_remove("sbp");
msg(DBG_INF, "%s module released.\n", major_name);
}
......
......@@ -1445,7 +1445,6 @@ static int __init sony535_init(void)
int got_result = 0;
int tmp_irq;
int i;
devfs_handle_t sony_devfs_handle;
int err;
/* Setting the base I/O address to 0 will disable it. */
......@@ -1547,11 +1546,6 @@ static int __init sony535_init(void)
printk("IRQ%d, ", tmp_irq);
printk("using %d byte buffer\n", sony_buffer_size);
sony_devfs_handle = devfs_register (NULL, CDU535_HANDLE,
DEVFS_FL_DEFAULT,
MAJOR_NR, 0,
S_IFBLK | S_IRUGO | S_IWUGO,
&cdu_fops, NULL);
if (register_blkdev(MAJOR_NR, CDU535_HANDLE, &cdu_fops)) {
printk("Unable to get major %d for %s\n",
MAJOR_NR, CDU535_MESSAGE_NAME);
......@@ -1595,6 +1589,10 @@ static int __init sony535_init(void)
}
cdu_disk->queue = &sonycd535_queue;
add_disk(cdu_disk);
devfs_register (NULL, CDU535_HANDLE, DEVFS_FL_DEFAULT,
cdu_disk->major, cdu_disk->first_minor,
S_IFBLK | S_IRUGO | S_IWUGO,
cdu_disk->fops, NULL);
return 0;
out7:
......@@ -1613,7 +1611,6 @@ static int __init sony535_init(void)
blk_cleanup_queue(&sonycd535_queue);
unregister_blkdev(MAJOR_NR, CDU535_HANDLE);
out1:
devfs_unregister(sony_devfs_handle);
if (sony535_irq_used)
free_irq(sony535_irq_used, NULL);
return err;
......
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