提交 95dc112a 编写于 作者: G Greg Kroah-Hartman

[PATCH] devfs: Remove devfs_mk_dir() function from the kernel tree

Removes the devfs_mk_dir() function and all callers of it.
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 0e6c62da
...@@ -841,7 +841,6 @@ int ubd_init(void) ...@@ -841,7 +841,6 @@ int ubd_init(void)
{ {
int i; int i;
devfs_mk_dir("ubd");
if (register_blkdev(MAJOR_NR, "ubd")) if (register_blkdev(MAJOR_NR, "ubd"))
return -1; return -1;
...@@ -855,7 +854,6 @@ int ubd_init(void) ...@@ -855,7 +854,6 @@ int ubd_init(void)
char name[sizeof("ubd_nnn\0")]; char name[sizeof("ubd_nnn\0")];
snprintf(name, sizeof(name), "ubd_%d", fake_major); snprintf(name, sizeof(name), "ubd_%d", fake_major);
devfs_mk_dir(name);
if (register_blkdev(fake_major, "ubd")) if (register_blkdev(fake_major, "ubd"))
return -1; return -1;
} }
......
...@@ -1005,7 +1005,6 @@ int slm_init( void ) ...@@ -1005,7 +1005,6 @@ int slm_init( void )
BufferP = SLMBuffer; BufferP = SLMBuffer;
SLMState = IDLE; SLMState = IDLE;
devfs_mk_dir("slm");
for (i = 0; i < MAX_SLM; i++) { for (i = 0; i < MAX_SLM; i++) {
devfs_mk_cdev(MKDEV(ACSI_MAJOR, i), devfs_mk_cdev(MKDEV(ACSI_MAJOR, i),
S_IFCHR|S_IRUSR|S_IWUSR, "slm/%d", i); S_IFCHR|S_IRUSR|S_IWUSR, "slm/%d", i);
......
...@@ -4261,8 +4261,6 @@ static int __init floppy_init(void) ...@@ -4261,8 +4261,6 @@ static int __init floppy_init(void)
motor_off_timer[dr].function = motor_off_callback; motor_off_timer[dr].function = motor_off_callback;
} }
devfs_mk_dir("floppy");
err = register_blkdev(FLOPPY_MAJOR, "fd"); err = register_blkdev(FLOPPY_MAJOR, "fd");
if (err) if (err)
goto out_devfs_remove; goto out_devfs_remove;
......
...@@ -1277,8 +1277,6 @@ static int __init loop_init(void) ...@@ -1277,8 +1277,6 @@ static int __init loop_init(void)
goto out_mem3; goto out_mem3;
} }
devfs_mk_dir("loop");
for (i = 0; i < max_loop; i++) { for (i = 0; i < max_loop; i++) {
struct loop_device *lo = &loop_dev[i]; struct loop_device *lo = &loop_dev[i];
struct gendisk *disk = disks[i]; struct gendisk *disk = disks[i];
......
...@@ -642,7 +642,6 @@ static int __init nbd_init(void) ...@@ -642,7 +642,6 @@ static int __init nbd_init(void)
printk(KERN_INFO "nbd: registered device at major %d\n", NBD_MAJOR); printk(KERN_INFO "nbd: registered device at major %d\n", NBD_MAJOR);
dprintk(DBG_INIT, "nbd: debugflags=0x%x\n", debugflags); dprintk(DBG_INIT, "nbd: debugflags=0x%x\n", debugflags);
devfs_mk_dir("nbd");
for (i = 0; i < nbds_max; i++) { for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = nbd_dev[i].disk; struct gendisk *disk = nbd_dev[i].disk;
nbd_dev[i].file = NULL; nbd_dev[i].file = NULL;
......
...@@ -674,7 +674,6 @@ static int __init pg_init(void) ...@@ -674,7 +674,6 @@ static int __init pg_init(void)
err = PTR_ERR(pg_class); err = PTR_ERR(pg_class);
goto out_chrdev; goto out_chrdev;
} }
devfs_mk_dir("pg");
for (unit = 0; unit < PG_UNITS; unit++) { for (unit = 0; unit < PG_UNITS; unit++) {
struct pg *dev = &devices[unit]; struct pg *dev = &devices[unit];
if (dev->present) { if (dev->present) {
......
...@@ -971,7 +971,6 @@ static int __init pt_init(void) ...@@ -971,7 +971,6 @@ static int __init pt_init(void)
goto out_chrdev; goto out_chrdev;
} }
devfs_mk_dir("pt");
for (unit = 0; unit < PT_UNITS; unit++) for (unit = 0; unit < PT_UNITS; unit++)
if (pt[unit].present) { if (pt[unit].present) {
class_device_create(pt_class, NULL, MKDEV(major, unit), class_device_create(pt_class, NULL, MKDEV(major, unit),
......
...@@ -442,8 +442,6 @@ static int __init rd_init(void) ...@@ -442,8 +442,6 @@ static int __init rd_init(void)
goto out; goto out;
} }
devfs_mk_dir("rd");
for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) {
struct gendisk *disk = rd_disks[i]; struct gendisk *disk = rd_disks[i];
......
...@@ -1019,8 +1019,6 @@ int swim3_init(void) ...@@ -1019,8 +1019,6 @@ int swim3_init(void)
int err = -ENOMEM; int err = -ENOMEM;
int i; int i;
devfs_mk_dir("floppy");
swim = find_devices("floppy"); swim = find_devices("floppy");
while (swim && (floppy_count < MAX_FLOPPIES)) while (swim && (floppy_count < MAX_FLOPPIES))
{ {
......
...@@ -1672,8 +1672,6 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1672,8 +1672,6 @@ static int carm_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
if (host->flags & FL_DYN_MAJOR) if (host->flags & FL_DYN_MAJOR)
host->major = rc; host->major = rc;
devfs_mk_dir(DRV_NAME);
rc = carm_init_disks(host); rc = carm_init_disks(host);
if (rc) if (rc)
goto err_out_blkdev_disks; goto err_out_blkdev_disks;
......
...@@ -2445,7 +2445,6 @@ static int __init ub_init(void) ...@@ -2445,7 +2445,6 @@ static int __init ub_init(void)
if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0) if ((rc = register_blkdev(UB_MAJOR, DRV_NAME)) != 0)
goto err_regblkdev; goto err_regblkdev;
devfs_mk_dir(DEVFS_NAME);
if ((rc = usb_register(&ub_driver)) != 0) if ((rc = usb_register(&ub_driver)) != 0)
goto err_register; goto err_register;
......
...@@ -5808,8 +5808,6 @@ int __init sbpcd_init(void) ...@@ -5808,8 +5808,6 @@ int __init sbpcd_init(void)
return -ENOMEM; return -ENOMEM;
} }
devfs_mk_dir("sbp");
for (j=0;j<NR_SBPCD;j++) for (j=0;j<NR_SBPCD;j++)
{ {
struct cdrom_device_info * sbpcd_infop; struct cdrom_device_info * sbpcd_infop;
......
...@@ -872,8 +872,6 @@ static __init int init_ipmi_devintf(void) ...@@ -872,8 +872,6 @@ static __init int init_ipmi_devintf(void)
ipmi_major = rv; ipmi_major = rv;
} }
devfs_mk_dir(DEVICE_NAME);
rv = ipmi_smi_watcher_register(&smi_watcher); rv = ipmi_smi_watcher_register(&smi_watcher);
if (rv) { if (rv) {
unregister_chrdev(ipmi_major, DEVICE_NAME); unregister_chrdev(ipmi_major, DEVICE_NAME);
......
...@@ -5213,7 +5213,6 @@ int __init stli_init(void) ...@@ -5213,7 +5213,6 @@ int __init stli_init(void)
printk(KERN_ERR "STALLION: failed to register serial memory " printk(KERN_ERR "STALLION: failed to register serial memory "
"device\n"); "device\n");
devfs_mk_dir("staliomem");
istallion_class = class_create(THIS_MODULE, "staliomem"); istallion_class = class_create(THIS_MODULE, "staliomem");
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
......
...@@ -907,7 +907,6 @@ static int __init lp_init (void) ...@@ -907,7 +907,6 @@ static int __init lp_init (void)
return -EIO; return -EIO;
} }
devfs_mk_dir("printers");
lp_class = class_create(THIS_MODULE, "printer"); lp_class = class_create(THIS_MODULE, "printer");
if (IS_ERR(lp_class)) { if (IS_ERR(lp_class)) {
err = PTR_ERR(lp_class); err = PTR_ERR(lp_class);
......
...@@ -782,7 +782,6 @@ static int __init ppdev_init (void) ...@@ -782,7 +782,6 @@ static int __init ppdev_init (void)
err = PTR_ERR(ppdev_class); err = PTR_ERR(ppdev_class);
goto out_chrdev; goto out_chrdev;
} }
devfs_mk_dir("parports");
for (i = 0; i < PARPORT_MAX; i++) { for (i = 0; i < PARPORT_MAX; i++) {
devfs_mk_cdev(MKDEV(PP_MAJOR, i), devfs_mk_cdev(MKDEV(PP_MAJOR, i),
S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i); S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i);
......
...@@ -351,7 +351,6 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, ...@@ -351,7 +351,6 @@ static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file,
static void __init unix98_pty_init(void) static void __init unix98_pty_init(void)
{ {
devfs_mk_dir("pts");
ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX); ptm_driver = alloc_tty_driver(NR_UNIX98_PTY_MAX);
if (!ptm_driver) if (!ptm_driver)
panic("Couldn't allocate Unix98 ptm driver"); panic("Couldn't allocate Unix98 ptm driver");
......
...@@ -3069,7 +3069,6 @@ static int __init stl_init(void) ...@@ -3069,7 +3069,6 @@ static int __init stl_init(void)
*/ */
if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem)) if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem))
printk("STALLION: failed to register serial board device\n"); printk("STALLION: failed to register serial board device\n");
devfs_mk_dir("staliomem");
stallion_class = class_create(THIS_MODULE, "staliomem"); stallion_class = class_create(THIS_MODULE, "staliomem");
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
......
...@@ -507,9 +507,6 @@ tipar_init_module(void) ...@@ -507,9 +507,6 @@ tipar_init_module(void)
goto out; goto out;
} }
/* Use devfs with tree: /dev/ticables/par/[0..2] */
devfs_mk_dir("ticables/par");
tipar_class = class_create(THIS_MODULE, "ticables"); tipar_class = class_create(THIS_MODULE, "ticables");
if (IS_ERR(tipar_class)) { if (IS_ERR(tipar_class)) {
err = PTR_ERR(tipar_class); err = PTR_ERR(tipar_class);
......
...@@ -68,7 +68,6 @@ static int dm_hash_init(void) ...@@ -68,7 +68,6 @@ static int dm_hash_init(void)
{ {
init_buckets(_name_buckets); init_buckets(_name_buckets);
init_buckets(_uuid_buckets); init_buckets(_uuid_buckets);
devfs_mk_dir(DM_DIR);
return 0; return 0;
} }
......
...@@ -5553,7 +5553,6 @@ static int __init md_init(void) ...@@ -5553,7 +5553,6 @@ static int __init md_init(void)
unregister_blkdev(MAJOR_NR, "md"); unregister_blkdev(MAJOR_NR, "md");
return -1; return -1;
} }
devfs_mk_dir("md");
blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE, blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE,
md_probe, NULL, NULL); md_probe, NULL, NULL);
blk_register_region(MKDEV(mdp_major, 0), MAX_MD_DEVS<<MdpMinorShift, THIS_MODULE, blk_register_region(MKDEV(mdp_major, 0), MAX_MD_DEVS<<MdpMinorShift, THIS_MODULE,
......
...@@ -302,7 +302,6 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu ...@@ -302,7 +302,6 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, struct modu
printk ("DVB: registering new adapter (%s).\n", name); printk ("DVB: registering new adapter (%s).\n", name);
devfs_mk_dir("dvb/adapter%d", num);
adap->num = num; adap->num = num;
adap->name = name; adap->name = name;
adap->module = module; adap->module = module;
...@@ -410,8 +409,6 @@ static int __init init_dvbdev(void) ...@@ -410,8 +409,6 @@ static int __init init_dvbdev(void)
goto error; goto error;
} }
devfs_mk_dir("dvb");
dvb_class = class_create(THIS_MODULE, "dvb"); dvb_class = class_create(THIS_MODULE, "dvb");
if (IS_ERR(dvb_class)) { if (IS_ERR(dvb_class)) {
retval = PTR_ERR(dvb_class); retval = PTR_ERR(dvb_class);
......
...@@ -555,7 +555,6 @@ static int __init mmc_blk_init(void) ...@@ -555,7 +555,6 @@ static int __init mmc_blk_init(void)
if (major == 0) if (major == 0)
major = res; major = res;
devfs_mk_dir("mmc");
return mmc_register_driver(&mmc_driver); return mmc_register_driver(&mmc_driver);
out: out:
......
...@@ -393,7 +393,6 @@ static int __init cosa_init(void) ...@@ -393,7 +393,6 @@ static int __init cosa_init(void)
err = -ENODEV; err = -ENODEV;
goto out; goto out;
} }
devfs_mk_dir("cosa");
cosa_class = class_create(THIS_MODULE, "cosa"); cosa_class = class_create(THIS_MODULE, "cosa");
if (IS_ERR(cosa_class)) { if (IS_ERR(cosa_class)) {
err = PTR_ERR(cosa_class); err = PTR_ERR(cosa_class);
......
...@@ -2111,9 +2111,6 @@ dasd_init(void) ...@@ -2111,9 +2111,6 @@ dasd_init(void)
dasd_diag_discipline_pointer = NULL; dasd_diag_discipline_pointer = NULL;
rc = devfs_mk_dir("dasd");
if (rc)
goto failed;
rc = dasd_devmap_init(); rc = dasd_devmap_init();
if (rc) if (rc)
goto failed; goto failed;
......
...@@ -439,8 +439,6 @@ static int __init xpram_setup_blkdev(void) ...@@ -439,8 +439,6 @@ static int __init xpram_setup_blkdev(void)
if (rc < 0) if (rc < 0)
goto out; goto out;
devfs_mk_dir("slram");
/* /*
* Assign the other needed values: make request function, sizes and * Assign the other needed values: make request function, sizes and
* hardsect size. All the minor devices feature the same value. * hardsect size. All the minor devices feature the same value.
......
...@@ -1031,7 +1031,6 @@ static int __init bpp_init(void) ...@@ -1031,7 +1031,6 @@ static int __init bpp_init(void)
instances[idx].opened = 0; instances[idx].opened = 0;
probeLptPort(idx); probeLptPort(idx);
} }
devfs_mk_dir("bpp");
for (idx = 0; idx < BPP_NO; idx++) { for (idx = 0; idx < BPP_NO; idx++) {
devfs_mk_cdev(MKDEV(BPP_MAJOR, idx), devfs_mk_cdev(MKDEV(BPP_MAJOR, idx),
S_IFCHR | S_IRUSR | S_IWUSR, "bpp/%d", idx); S_IFCHR | S_IRUSR | S_IWUSR, "bpp/%d", idx);
......
...@@ -677,7 +677,6 @@ static int vfc_probe(void) ...@@ -677,7 +677,6 @@ static int vfc_probe(void)
kfree(vfc_dev_lst); kfree(vfc_dev_lst);
return -EIO; return -EIO;
} }
devfs_mk_dir("vfc");
instance = 0; instance = 0;
for_all_sbusdev(sdev, sbus) { for_all_sbusdev(sdev, sbus) {
if (strcmp(sdev->prom_name, "vfc") == 0) { if (strcmp(sdev->prom_name, "vfc") == 0) {
......
...@@ -1432,7 +1432,6 @@ fbmem_init(void) ...@@ -1432,7 +1432,6 @@ fbmem_init(void)
{ {
create_proc_read_entry("fb", 0, NULL, fbmem_read_proc, NULL); create_proc_read_entry("fb", 0, NULL, fbmem_read_proc, NULL);
devfs_mk_dir("fb");
if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
printk("unable to get major %d for fb devs\n", FB_MAJOR); printk("unable to get major %d for fb devs\n", FB_MAJOR);
......
...@@ -365,7 +365,6 @@ static int init_coda_psdev(void) ...@@ -365,7 +365,6 @@ static int init_coda_psdev(void)
err = PTR_ERR(coda_psdev_class); err = PTR_ERR(coda_psdev_class);
goto out_chrdev; goto out_chrdev;
} }
devfs_mk_dir ("coda");
for (i = 0; i < MAX_CODADEVS; i++) { for (i = 0; i < MAX_CODADEVS; i++) {
class_device_create(coda_psdev_class, NULL, class_device_create(coda_psdev_class, NULL,
MKDEV(CODA_PSDEV_MAJOR,i), NULL, "cfs%d", i); MKDEV(CODA_PSDEV_MAJOR,i), NULL, "cfs%d", i);
......
...@@ -18,10 +18,6 @@ static inline int devfs_mk_symlink(const char *name, const char *link) ...@@ -18,10 +18,6 @@ static inline int devfs_mk_symlink(const char *name, const char *link)
{ {
return 0; return 0;
} }
static inline int devfs_mk_dir(const char *fmt, ...)
{
return 0;
}
static inline void devfs_remove(const char *fmt, ...) static inline void devfs_remove(const char *fmt, ...)
{ {
} }
......
...@@ -2252,9 +2252,7 @@ static int __init init_tmpfs(void) ...@@ -2252,9 +2252,7 @@ static int __init init_tmpfs(void)
printk(KERN_ERR "Could not register tmpfs\n"); printk(KERN_ERR "Could not register tmpfs\n");
goto out2; goto out2;
} }
#ifdef CONFIG_TMPFS
devfs_mk_dir("shm");
#endif
shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER, shm_mnt = vfs_kern_mount(&tmpfs_fs_type, MS_NOUSER,
tmpfs_fs_type.name, NULL); tmpfs_fs_type.name, NULL);
if (IS_ERR(shm_mnt)) { if (IS_ERR(shm_mnt)) {
......
...@@ -33,9 +33,6 @@ static int __init init_tmpfs(void) ...@@ -33,9 +33,6 @@ static int __init init_tmpfs(void)
{ {
BUG_ON(register_filesystem(&tmpfs_fs_type) != 0); BUG_ON(register_filesystem(&tmpfs_fs_type) != 0);
#ifdef CONFIG_TMPFS
devfs_mk_dir("shm");
#endif
shm_mnt = kern_mount(&tmpfs_fs_type); shm_mnt = kern_mount(&tmpfs_fs_type);
BUG_ON(IS_ERR(shm_mnt)); BUG_ON(IS_ERR(shm_mnt));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册