Skip to content

Commit

Permalink
[PATCH] devfs: Remove devfs_remove() function from the kernel tree
Browse files Browse the repository at this point in the history
Removes the devfs_remove() function and all callers of it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
gregkh committed Jun 26, 2006
1 parent 7c69ef7 commit 8ab5e4c
Show file tree
Hide file tree
Showing 47 changed files with 9 additions and 161 deletions.
1 change: 0 additions & 1 deletion arch/sparc64/solaris/socksys.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,5 +205,4 @@ cleanup_socksys(void)
{
if (unregister_chrdev(30, "socksys"))
printk ("Couldn't unregister socksys character device\n");
devfs_remove ("socksys");
}
4 changes: 0 additions & 4 deletions drivers/block/acsi_slm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,10 +1027,6 @@ int init_module(void)

void cleanup_module(void)
{
int i;
for (i = 0; i < MAX_SLM; i++)
devfs_remove("slm/%d", i);
devfs_remove("slm");
if (unregister_chrdev( ACSI_MAJOR, "slm" ) != 0)
printk( KERN_ERR "acsi_slm: cleanup_module failed\n");
atari_stram_free( SLMBuffer );
Expand Down
2 changes: 0 additions & 2 deletions drivers/block/cpqarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ static void __devexit cpqarray_remove_one(int i)
for(j = 0; j < NWD; j++) {
if (ida_gendisk[i][j]->flags & GENHD_FL_UP)
del_gendisk(ida_gendisk[i][j]);
devfs_remove("ida/c%dd%d",i,j);
put_disk(ida_gendisk[i][j]);
}
blk_cleanup_queue(hba[i]->queue);
Expand Down Expand Up @@ -1844,7 +1843,6 @@ static void __exit cpqarray_exit(void)
}
}

devfs_remove("ida");
remove_proc_entry("cpqarray", proc_root_driver);
}

Expand Down
33 changes: 1 addition & 32 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3952,20 +3952,6 @@ static struct block_device_operations floppy_fops = {
.media_changed = check_floppy_change,
.revalidate_disk = floppy_revalidate,
};
static char *table[] = {
"", "d360", "h1200", "u360", "u720", "h360", "h720",
"u1440", "u2880", "CompaQ", "h1440", "u1680", "h410",
"u820", "h1476", "u1722", "h420", "u830", "h1494", "u1743",
"h880", "u1040", "u1120", "h1600", "u1760", "u1920",
"u3200", "u3520", "u3840", "u1840", "u800", "u1600",
NULL
};
static int t360[] = { 1, 0 },
t1200[] = { 2, 5, 6, 10, 12, 14, 16, 18, 20, 23, 0 },
t3in[] = { 8, 9, 26, 27, 28, 7, 11, 15, 19, 24, 25, 29, 31, 3, 4, 13,
17, 21, 22, 30, 0 };
static int *table_sup[] =
{ NULL, t360, t1200, t3in + 5 + 8, t3in + 5, t3in, t3in };

/*
* Floppy Driver initialization
Expand Down Expand Up @@ -4244,7 +4230,7 @@ static int __init floppy_init(void)

err = register_blkdev(FLOPPY_MAJOR, "fd");
if (err)
goto out_devfs_remove;
goto out_put_disk;

floppy_queue = blk_init_queue(do_fd_request, &floppy_lock);
if (!floppy_queue) {
Expand Down Expand Up @@ -4403,8 +4389,6 @@ static int __init floppy_init(void)
blk_cleanup_queue(floppy_queue);
out_unreg_blkdev:
unregister_blkdev(FLOPPY_MAJOR, "fd");
out_devfs_remove:
devfs_remove("floppy");
out_put_disk:
while (dr--) {
del_timer(&motor_off_timer[dr]);
Expand Down Expand Up @@ -4565,19 +4549,6 @@ static void floppy_release_irq_and_dma(void)

static char *floppy;

static void unregister_devfs_entries(int drive)
{
int i;

if (UDP->cmos < ARRAY_SIZE(default_drive_params)) {
i = 0;
do {
devfs_remove("floppy/%d%s", drive,
table[table_sup[UDP->cmos][i]]);
} while (table_sup[UDP->cmos][i++]);
}
}

static void __init parse_floppy_cfg_string(char *cfg)
{
char *ptr;
Expand Down Expand Up @@ -4614,13 +4585,11 @@ void cleanup_module(void)
if ((allowed_drive_mask & (1 << drive)) &&
fdc_state[FDC(drive)].version != FDC_NONE) {
del_gendisk(disks[drive]);
unregister_devfs_entries(drive);
device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
platform_device_unregister(&floppy_device[drive]);
}
put_disk(disks[drive]);
}
devfs_remove("floppy");

del_timer_sync(&fd_timeout);
del_timer_sync(&fd_timer);
Expand Down
2 changes: 0 additions & 2 deletions drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,6 @@ static int __init loop_init(void)
out_mem4:
while (i--)
blk_cleanup_queue(loop_dev[i].lo_queue);
devfs_remove("loop");
i = max_loop;
out_mem3:
while (i--)
Expand All @@ -1331,7 +1330,6 @@ static void loop_exit(void)
blk_cleanup_queue(loop_dev[i].lo_queue);
put_disk(disks[i]);
}
devfs_remove("loop");
if (unregister_blkdev(LOOP_MAJOR, "loop"))
printk(KERN_WARNING "loop: cannot unregister blkdev\n");

Expand Down
1 change: 0 additions & 1 deletion drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ static void __exit nbd_cleanup(void)
put_disk(disk);
}
}
devfs_remove("nbd");
unregister_blkdev(NBD_MAJOR, "nbd");
printk(KERN_INFO "nbd: unregistered device at major %d\n", NBD_MAJOR);
}
Expand Down
5 changes: 1 addition & 4 deletions drivers/block/paride/pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,13 +695,10 @@ static void __exit pg_exit(void)

for (unit = 0; unit < PG_UNITS; unit++) {
struct pg *dev = &devices[unit];
if (dev->present) {
if (dev->present)
class_device_destroy(pg_class, MKDEV(major, unit));
devfs_remove("pg/%u", unit);
}
}
class_destroy(pg_class);
devfs_remove("pg");
unregister_chrdev(major, name);

for (unit = 0; unit < PG_UNITS; unit++) {
Expand Down
3 changes: 0 additions & 3 deletions drivers/block/paride/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,12 +992,9 @@ static void __exit pt_exit(void)
for (unit = 0; unit < PT_UNITS; unit++)
if (pt[unit].present) {
class_device_destroy(pt_class, MKDEV(major, unit));
devfs_remove("pt/%d", unit);
class_device_destroy(pt_class, MKDEV(major, unit + 128));
devfs_remove("pt/%dn", unit);
}
class_destroy(pt_class);
devfs_remove("pt");
unregister_chrdev(major, name);
for (unit = 0; unit < PT_UNITS; unit++)
if (pt[unit].present)
Expand Down
1 change: 0 additions & 1 deletion drivers/block/rd.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ static void __exit rd_cleanup(void)
put_disk(rd_disks[i]);
blk_cleanup_queue(rd_queue[i]);
}
devfs_remove("rd");
unregister_blkdev(RAMDISK_MAJOR, "ramdisk");
}

Expand Down
1 change: 0 additions & 1 deletion drivers/block/sx8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1736,7 +1736,6 @@ static void carm_remove_one (struct pci_dev *pdev)

free_irq(pdev->irq, host);
carm_free_disks(host);
devfs_remove(DRV_NAME);
unregister_blkdev(host->major, host->name);
if (host->major == 160)
clear_bit(0, &carm_major_alloc);
Expand Down
2 changes: 0 additions & 2 deletions drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,6 @@ static int __init ub_init(void)
return 0;

err_register:
devfs_remove(DEVFS_NAME);
unregister_blkdev(UB_MAJOR, DRV_NAME);
err_regblkdev:
return rc;
Expand All @@ -2463,7 +2462,6 @@ static void __exit ub_exit(void)
{
usb_deregister(&ub_driver);

devfs_remove(DEVFS_NAME);
unregister_blkdev(UB_MAJOR, DRV_NAME);
usb_usual_clear_present(USB_US_TYPE_UB);
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/cdrom/sbpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -5904,7 +5904,6 @@ static void sbpcd_exit(void)
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);
Expand All @@ -5915,7 +5914,6 @@ static void sbpcd_exit(void)
}
vfree(D_S[j].sbpcd_infop);
}
devfs_remove("sbp");
msg(DBG_INF, "%s module released.\n", major_name);
}

Expand Down
1 change: 0 additions & 1 deletion drivers/char/dsp56k.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,6 @@ static void __exit dsp56k_cleanup_driver(void)
class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
class_destroy(dsp56k_class);
unregister_chrdev(DSP56K_MAJOR, "dsp56k");
devfs_remove("dsp56k");
}
module_exit(dsp56k_cleanup_driver);

Expand Down
1 change: 0 additions & 1 deletion drivers/char/dtlk.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ static void __exit dtlk_cleanup (void)

dtlk_write_tts(DTLK_CLEAR);
unregister_chrdev(dtlk_major, "dtlk");
devfs_remove("dtlk");
release_region(dtlk_port_lpc, DTLK_IO_EXTENT);
}

Expand Down
6 changes: 0 additions & 6 deletions drivers/char/ftape/zftape/zftape-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,17 +362,11 @@ static void zft_exit(void)
TRACE(ft_t_info, "successful");
}
for (i = 0; i < 4; i++) {
devfs_remove("qft%i", i);
class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i));
devfs_remove("nqft%i", i);
class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 4));
devfs_remove("zqft%i", i);
class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 16));
devfs_remove("nzqft%i", i);
class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 20));
devfs_remove("rawqft%i", i);
class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 32));
devfs_remove("nrawqft%i", i);
class_device_destroy(zft_class, MKDEV(QIC117_TAPE_MAJOR, i + 36));
}
class_destroy(zft_class);
Expand Down
3 changes: 0 additions & 3 deletions drivers/char/ip2/ip2main.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,7 @@ cleanup_module(void)
/* free io addresses and Tibet */
release_region( ip2config.addr[i], 8 );
class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i));
devfs_remove("ip2/ipl%d", i);
class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
devfs_remove("ip2/stat%d", i);
}
/* Disable and remove interrupt handler. */
if ( (ip2config.irq[i] > 0) && have_requested_irq(ip2config.irq[i]) ) {
Expand All @@ -425,7 +423,6 @@ cleanup_module(void)
}
}
class_destroy(ip2_class);
devfs_remove("ip2");
if ( ( err = tty_unregister_driver ( ip2_tty_driver ) ) ) {
printk(KERN_ERR "IP2: failed to unregister tty driver (%d)\n", err);
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/char/ipmi/ipmi_devintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,6 @@ static void ipmi_smi_gone(int if_num)
}
class_device_destroy(ipmi_class, dev);
mutex_unlock(&reg_list_mutex);
devfs_remove("ipmidev/%d", if_num);
}

static struct ipmi_smi_watcher smi_watcher =
Expand Down Expand Up @@ -893,7 +892,6 @@ static __exit void cleanup_ipmi(void)
mutex_unlock(&reg_list_mutex);
class_destroy(ipmi_class);
ipmi_smi_watcher_unregister(&smi_watcher);
devfs_remove(DEVICE_NAME);
unregister_chrdev(ipmi_major, DEVICE_NAME);
}
module_exit(cleanup_ipmi);
Expand Down
5 changes: 1 addition & 4 deletions drivers/char/istallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,11 +849,8 @@ static void __exit istallion_module_exit(void)
return;
}
put_tty_driver(stli_serial);
for (i = 0; i < 4; i++) {
devfs_remove("staliomem/%d", i);
for (i = 0; i < 4; i++)
class_device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR, i));
}
devfs_remove("staliomem");
class_destroy(istallion_class);
if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
printk("STALLION: failed to un-register serial memory device, "
Expand Down
3 changes: 0 additions & 3 deletions drivers/char/lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,6 @@ static int __init lp_init (void)
out_class:
class_destroy(lp_class);
out_devfs:
devfs_remove("printers");
unregister_chrdev(LP_MAJOR, "lp");
return err;
}
Expand Down Expand Up @@ -978,10 +977,8 @@ static void lp_cleanup_module (void)
if (lp_table[offset].dev == NULL)
continue;
parport_unregister_device(lp_table[offset].dev);
devfs_remove("printers/%d", offset);
class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset));
}
devfs_remove("printers");
class_destroy(lp_class);
}

Expand Down
1 change: 0 additions & 1 deletion drivers/char/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ int misc_deregister(struct miscdevice * misc)
down(&misc_sem);
list_del(&misc->list);
class_device_destroy(misc_class, MKDEV(MISC_MAJOR, misc->minor));
devfs_remove(misc->devfs_name);
if (i < DYNAMIC_MINORS && i>0) {
misc_minors[i>>3] &= ~(1 << (misc->minor & 7));
}
Expand Down
9 changes: 1 addition & 8 deletions drivers/char/ppdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ static struct parport_driver pp_driver = {

static int __init ppdev_init (void)
{
int i, err = 0;
int err = 0;

if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
printk (KERN_WARNING CHRDEV ": unable to get major %d\n",
Expand All @@ -791,9 +791,6 @@ static int __init ppdev_init (void)
goto out;

out_class:
for (i = 0; i < PARPORT_MAX; i++)
devfs_remove("parports/%d", i);
devfs_remove("parports");
class_destroy(ppdev_class);
out_chrdev:
unregister_chrdev(PP_MAJOR, CHRDEV);
Expand All @@ -803,12 +800,8 @@ static int __init ppdev_init (void)

static void __exit ppdev_cleanup (void)
{
int i;
/* Clean up all parport stuff */
for (i = 0; i < PARPORT_MAX; i++)
devfs_remove("parports/%d", i);
parport_unregister_driver(&pp_driver);
devfs_remove("parports");
class_destroy(ppdev_class);
unregister_chrdev (PP_MAJOR, CHRDEV);
}
Expand Down
6 changes: 0 additions & 6 deletions drivers/char/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,6 @@ static int __init raw_init(void)

static void __exit raw_exit(void)
{
int i;

for (i = 1; i < MAX_RAW_MINORS; i++)
devfs_remove("raw/raw%d", i);
devfs_remove("raw/rawctl");
devfs_remove("raw");
class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
class_destroy(raw_class);
cdev_del(&raw_cdev);
Expand Down
5 changes: 1 addition & 4 deletions drivers/char/stallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,11 +773,8 @@ static void __exit stallion_module_exit(void)
restore_flags(flags);
return;
}
for (i = 0; i < 4; i++) {
devfs_remove("staliomem/%d", i);
for (i = 0; i < 4; i++)
class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
}
devfs_remove("staliomem");
if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
printk("STALLION: failed to un-register serial memory device, "
"errno=%d\n", -i);
Expand Down
3 changes: 0 additions & 3 deletions drivers/char/tipar.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,6 @@ tipar_init_module(void)
class_destroy(tipar_class);

out_chrdev:
devfs_remove("ticables/par");
unregister_chrdev(TIPAR_MAJOR, "tipar");
out:
return err;
Expand All @@ -536,10 +535,8 @@ tipar_cleanup_module(void)
continue;
parport_unregister_device(table[i].dev);
class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i));
devfs_remove("ticables/par/%d", i);
}
class_destroy(tipar_class);
devfs_remove("ticables/par");

pr_info("tipar: module unloaded\n");
}
Expand Down
1 change: 0 additions & 1 deletion drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2997,7 +2997,6 @@ struct class_device *tty_register_device(struct tty_driver *driver,
*/
void tty_unregister_device(struct tty_driver *driver, unsigned index)
{
devfs_remove("%s%d", driver->devfs_name, index + driver->name_base);
class_device_destroy(tty_class, MKDEV(driver->major, driver->minor_start) + index);
}

Expand Down
Loading

0 comments on commit 8ab5e4c

Please sign in to comment.