]> git.hungrycats.org Git - linux/commitdiff
Removed devfs_register_chrdev and devfs_unregister_chrdev.
authorGreg Kroah-Hartman <greg@kroah.com>
Tue, 30 Jul 2002 07:38:11 +0000 (00:38 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 30 Jul 2002 07:38:11 +0000 (00:38 -0700)
Use register_chrdev and unregister_chrdev as before, and everything will work.

49 files changed:
arch/m68k/atari/joystick.c
arch/sparc64/solaris/socksys.c
drivers/block/acsi_slm.c
drivers/block/paride/pg.c
drivers/block/paride/pt.c
drivers/char/dsp56k.c
drivers/char/dtlk.c
drivers/char/ftape/zftape/zftape-init.c
drivers/char/ip2main.c
drivers/char/istallion.c
drivers/char/lp.c
drivers/char/mem.c
drivers/char/misc.c
drivers/char/ppdev.c
drivers/char/stallion.c
drivers/char/tpqic02.c
drivers/char/tty_io.c
drivers/char/vc_screen.c
drivers/i2c/i2c-dev.c
drivers/ide/ide-tape.c
drivers/input/input.c
drivers/isdn/capi/capi.c
drivers/isdn/i4l/isdn_common.c
drivers/macintosh/adb.c
drivers/md/lvm.c
drivers/media/video/videodev.c
drivers/mtd/mtdchar.c
drivers/net/ppp_generic.c
drivers/net/wan/cosa.c
drivers/s390/char/tapechar.c
drivers/s390/char/tubfs.c
drivers/sbus/audio/audio.c
drivers/sbus/char/bpp.c
drivers/sbus/char/sunkbd.c
drivers/sbus/char/vfc_dev.c
drivers/scsi/osst.c
drivers/scsi/sg.c
drivers/scsi/st.c
drivers/sgi/char/shmiq.c
drivers/usb/core/file.c
drivers/usb/misc/tiglusb.c
drivers/video/fbmem.c
fs/coda/psdev.c
fs/devfs/base.c
fs/devices.c
include/linux/devfs_fs_kernel.h
net/netlink/netlink_dev.c
sound/core/sound.c
sound/sound_core.c

index 9c743ba9f3491421a903643433aa1aa88f1c41a0..df7da2e7a90ea3a73f871b273ba5bd504c137c0e 100644 (file)
@@ -134,7 +134,7 @@ int __init atari_joystick_init(void)
     init_waitqueue_head(&joystick[0].wait);
     init_waitqueue_head(&joystick[1].wait);
 
-    if (devfs_register_chrdev(MAJOR_NR, "Joystick", &atari_joystick_fops))
+    if (register_chrdev(MAJOR_NR, "Joystick", &atari_joystick_fops))
        printk("unable to get major %d for joystick devices\n", MAJOR_NR);
     devfs_register_series (NULL, "joysticks/digital%u", 2, DEVFS_FL_DEFAULT,
                           MAJOR_NR, 128, S_IFCHR | S_IRUSR | S_IWUSR,
index 5a91f34ef630c2b83030521079ce6d4d99aefc00..84399fb8a1a74958cc0cdfa783e086fc8744116b 100644 (file)
@@ -181,7 +181,7 @@ init_socksys(void)
        int (*sys_close)(unsigned int) = 
                (int (*)(unsigned int))SYS(close);
        
-       ret = devfs_register_chrdev (30, "socksys", &socksys_fops);
+       ret = register_chrdev (30, "socksys", &socksys_fops);
        if (ret < 0) {
                printk ("Couldn't register socksys character device\n");
                return ret;
@@ -208,7 +208,7 @@ init_socksys(void)
 void
 cleanup_socksys(void)
 {
-       if (devfs_unregister_chrdev(30, "socksys"))
+       if (unregister_chrdev(30, "socksys"))
                printk ("Couldn't unregister socksys character device\n");
        devfs_unregister (devfs_handle);
 }
index 59ceb6203db8922b2247cee6677902d991da41af..b2bb106d246460e8515937597d51bd88b283d36e 100644 (file)
@@ -998,14 +998,14 @@ static devfs_handle_t devfs_handle;
 int slm_init( void )
 
 {
-       if (devfs_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 );
                return -EBUSY;
        }
        
        if (!(SLMBuffer = atari_stram_alloc( SLM_BUFFER_SIZE, NULL, "SLM" ))) {
                printk( KERN_ERR "Unable to get SLM ST-Ram buffer.\n" );
-               devfs_unregister_chrdev( MAJOR_NR, "slm" );
+               unregister_chrdev( MAJOR_NR, "slm" );
                return -ENOMEM;
        }
        BufferP = SLMBuffer;
@@ -1038,7 +1038,7 @@ int init_module(void)
 void cleanup_module(void)
 {
        devfs_unregister (devfs_handle);
-       if (devfs_unregister_chrdev( MAJOR_NR, "slm" ) != 0)
+       if (unregister_chrdev( MAJOR_NR, "slm" ) != 0)
                printk( KERN_ERR "acsi_slm: cleanup_module failed\n");
        atari_stram_free( SLMBuffer );
 }
index 0a43b4a5d61bed980d6474b1694c7d8ef4a73e0c..53650db8bc987a5273680ddb16648c3ff41e33d3 100644 (file)
@@ -637,7 +637,7 @@ static int __init pg_init(void)
        if (pg_detect())
                return -1;
 
-       if (devfs_register_chrdev(major,name,&pg_fops)) {
+       if (register_chrdev(major,name,&pg_fops)) {
                printk("pg_init: unable to get major number %d\n",
                        major);
                for (unit=0;unit<PG_UNITS;unit++)
@@ -656,7 +656,7 @@ static void __exit pg_exit(void)
        int unit;
 
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev(major,name);
+       unregister_chrdev(major,name);
 
        for (unit=0;unit<PG_UNITS;unit++)
                if (PG.present) pi_release(PI);
index bc987791fd328a09e730be76f1e7d2dbdd774cea..4f1866f368753f94cec4269506efaca78e46e02d 100644 (file)
@@ -907,7 +907,7 @@ static int __init pt_init(void)
        if (pt_detect())
                return -1;
 
-       if (devfs_register_chrdev(major,name,&pt_fops)) {
+       if (register_chrdev(major,name,&pt_fops)) {
                printk("pt_init: unable to get major number %d\n",
                        major);
                for (unit=0;unit<PT_UNITS;unit++)
@@ -929,7 +929,7 @@ static void __exit pt_exit(void)
 {
        int unit;
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev(major,name);
+       unregister_chrdev(major,name);
        for (unit=0;unit<PT_UNITS;unit++)
                if (PT.present)
                        pi_release(PI);
index c964b569878aa935df50890fe080e67eceb54ba6..eefbe009c6f0a5052c10d5e6d9c7b036bd2be7a9 100644 (file)
@@ -510,7 +510,7 @@ static int __init dsp56k_init_driver(void)
                return -ENODEV;
        }
 
-       if(devfs_register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) {
+       if(register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) {
                printk("DSP56k driver: Unable to register driver\n");
                return -ENODEV;
        }
@@ -526,7 +526,7 @@ module_init(dsp56k_init_driver);
 
 static void __exit dsp56k_cleanup_driver(void)
 {
-       devfs_unregister_chrdev(DSP56K_MAJOR, "dsp56k");
+       unregister_chrdev(DSP56K_MAJOR, "dsp56k");
        devfs_unregister(devfs_handle);
 }
 module_exit(dsp56k_cleanup_driver);
index f8394c5f92883ab3f4c61a4b725d6532b66e1e33..82f5be2cf0de61de8c3667eff92324e9799b1349 100644 (file)
@@ -340,7 +340,7 @@ static int __init dtlk_init(void)
        dtlk_port_lpc = 0;
        dtlk_port_tts = 0;
        dtlk_busy = 0;
-       dtlk_major = devfs_register_chrdev(0, "dtlk", &dtlk_fops);
+       dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops);
        if (dtlk_major == 0) {
                printk(KERN_ERR "DoubleTalk PC - cannot register device\n");
                return 0;
@@ -369,7 +369,7 @@ static void __exit dtlk_cleanup (void)
                                                   signals... */
 
        dtlk_write_tts(DTLK_CLEAR);
-       devfs_unregister_chrdev(dtlk_major, "dtlk");
+       unregister_chrdev(dtlk_major, "dtlk");
        devfs_unregister(devfs_handle);
        release_region(dtlk_port_lpc, DTLK_IO_EXTENT);
 }
index 4e2621270d0e531320a033be516209dbccfce983..da92cbbbf0a4580988a6b5d4f773cf02e2fcca5e 100644 (file)
@@ -345,7 +345,7 @@ KERN_INFO
        TRACE(ft_t_info, "zft_init @ 0x%p", zft_init);
        TRACE(ft_t_info,
              "installing zftape VFS interface for ftape driver ...");
-       TRACE_CATCH(devfs_register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
+       TRACE_CATCH(register_chrdev(QIC117_TAPE_MAJOR, "zft", &zft_cdev),);
 
        for (i = 0; i < 4; i++) {
                char devname[9];
@@ -419,7 +419,7 @@ void cleanup_module(void)
 
        TRACE_FUN(ft_t_flow);
 
-       if (devfs_unregister_chrdev(QIC117_TAPE_MAJOR, "zft") != 0) {
+       if (unregister_chrdev(QIC117_TAPE_MAJOR, "zft") != 0) {
                TRACE(ft_t_warn, "failed");
        } else {
                TRACE(ft_t_info, "successful");
index 007a970c9623b2dd58abc574cb4e5bdf82276172..a956deb09a6dbdd4c49be1014e1ecbc81b95bbd3 100644 (file)
@@ -531,12 +531,7 @@ cleanup_module(void)
        if ( ( err = tty_unregister_driver ( &ip2_callout_driver ) ) ) {
                printk(KERN_ERR "IP2: failed to unregister callout driver (%d)\n", err);
        }
-#ifdef CONFIG_DEVFS_FS
-       if ( ( err = devfs_unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) )
-#else
-       if ( ( err = unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) )
-#endif
-       {
+       if ( ( err = unregister_chrdev ( IP2_IPL_MAJOR, pcIpl ) ) ) {
                printk(KERN_ERR "IP2: failed to unregister IPL driver (%d)\n", err);
        }
        remove_proc_entry("ip2mem", &proc_root);
@@ -866,12 +861,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
                printk(KERN_ERR "IP2: failed to register callout driver (%d)\n", err);
        } else
        /* Register the IPL driver. */
-#ifdef CONFIG_DEVFS_FS
-       if (( err = devfs_register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl )))
-#else
-       if ( ( err = register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl ) ) )
-#endif
-       {
+       if ( ( err = register_chrdev ( IP2_IPL_MAJOR, pcIpl, &ip2_ipl ) ) ) {
                printk(KERN_ERR "IP2: failed to register IPL device (%d)\n", err );
        } else
        /* Register the read_procmem thing */
index a2b10e0bc4fe337511c6e61095d6c4a802125796..0bd3573facc05d7707263603bc3f05f4243ea7ae 100644 (file)
@@ -869,7 +869,7 @@ void cleanup_module()
                return;
        }
        devfs_unregister (devfs_handle);
-       if ((i = devfs_unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
+       if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
                printk("STALLION: failed to un-register serial memory device, "
                        "errno=%d\n", -i);
        if (stli_tmpwritebuf != (char *) NULL)
@@ -5329,7 +5329,7 @@ int __init stli_init(void)
  *     Set up a character driver for the shared memory region. We need this
  *     to down load the slave code image. Also it is a useful debugging tool.
  */
-       if (devfs_register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stli_fsiomem))
+       if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stli_fsiomem))
                printk(KERN_ERR "STALLION: failed to register serial memory "
                                "device\n");
 
index 618664b56d2805e569e9e3945ae8377929bab99c..d9360bb453a390a2b659a540ea41f7ef621b39b6 100644 (file)
@@ -903,7 +903,7 @@ int __init lp_init (void)
                lp_table[i].timeout = 10 * HZ;
        }
 
-       if (devfs_register_chrdev (LP_MAJOR, "lp", &lp_fops)) {
+       if (register_chrdev (LP_MAJOR, "lp", &lp_fops)) {
                printk ("lp: unable to get major %d\n", LP_MAJOR);
                return -EIO;
        }
@@ -965,7 +965,7 @@ static void lp_cleanup_module (void)
 #endif
 
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev(LP_MAJOR, "lp");
+       unregister_chrdev(LP_MAJOR, "lp");
        for (offset = 0; offset < LP_NO; offset++) {
                if (lp_table[offset].dev == NULL)
                        continue;
index 07af77b4ad12d530a4c2a659ba024361ed952da3..611aad3bbfc688db831085c595d284a97a5110e8 100644 (file)
@@ -651,7 +651,7 @@ static struct file_operations memory_fops = {
 
 int __init chr_dev_init(void)
 {
-       if (devfs_register_chrdev(MEM_MAJOR,"mem",&memory_fops))
+       if (register_chrdev(MEM_MAJOR,"mem",&memory_fops))
                printk("unable to get major %d for memory devs\n", MEM_MAJOR);
        memory_devfs_register();
        rand_initialize();
index e410c4a65a79b109bbf87a58c08d20ae3ca23fa7..2149e30bbca2cbf2ecc9e820f0a90f6947621077 100644 (file)
@@ -281,7 +281,7 @@ int __init misc_init(void)
 #ifdef CONFIG_I8K
        i8k_init();
 #endif
-       if (devfs_register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
+       if (register_chrdev(MISC_MAJOR,"misc",&misc_fops)) {
                printk("unable to get major %d for misc devices\n",
                       MISC_MAJOR);
                return -EIO;
index 87676b34c17cafd8d4754b4df67b64f156e4cf4a..ebd3bafe34e832d527304f77ec6b4117a8f63512 100644 (file)
@@ -749,7 +749,7 @@ static devfs_handle_t devfs_handle;
 
 static int __init ppdev_init (void)
 {
-       if (devfs_register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
+       if (register_chrdev (PP_MAJOR, CHRDEV, &pp_fops)) {
                printk (KERN_WARNING CHRDEV ": unable to get major %d\n",
                        PP_MAJOR);
                return -EIO;
@@ -768,7 +768,7 @@ static void __exit ppdev_cleanup (void)
 {
        /* Clean up all parport stuff */
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev (PP_MAJOR, CHRDEV);
+       unregister_chrdev (PP_MAJOR, CHRDEV);
 }
 
 module_init(ppdev_init);
index 1acb3622b2afc9477cf4f25506c306830829f25d..1c539767fdb9f854cc25c7ac8883e3d04cff728a 100644 (file)
@@ -810,7 +810,7 @@ void cleanup_module()
                return;
        }
        devfs_unregister (devfs_handle);
-       if ((i = devfs_unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
+       if ((i = unregister_chrdev(STL_SIOMEMMAJOR, "staliomem")))
                printk("STALLION: failed to un-register serial memory device, "
                        "errno=%d\n", -i);
 
@@ -3208,7 +3208,7 @@ int __init stl_init(void)
  *     Set up a character driver for per board stuff. This is mainly used
  *     to do stats ioctls on the ports.
  */
-       if (devfs_register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem))
+       if (register_chrdev(STL_SIOMEMMAJOR, "staliomem", &stl_fsiomem))
                printk("STALLION: failed to register serial board device\n");
        devfs_handle = devfs_mk_dir (NULL, "staliomem", NULL);
        devfs_register_series (devfs_handle, "%u", 4, DEVFS_FL_DEFAULT,
index cf2d9e76e3d12cc02a52e665767ad5ef6c4b2488..45fdc494a0a876f85bc278daa90e2accd7a10ff6 100644 (file)
@@ -2846,7 +2846,7 @@ int __init qic02_tape_init(void)
 #endif
        printk(TPQIC02_NAME ": DMA buffers: %u blocks\n", NR_BLK_BUF);
        /* If we got this far, install driver functions */
-       if (devfs_register_chrdev
+       if (register_chrdev
            (QIC02_TAPE_MAJOR, TPQIC02_NAME, &qic02_tape_fops)) {
                printk(TPQIC02_NAME ": Unable to get chrdev major %d\n",
                       QIC02_TAPE_MAJOR);
@@ -2930,7 +2930,7 @@ void cleanup_module(void)
        if (status_zombie == NO) {
                qic02_release_resources();
        }
-       devfs_unregister_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME);
+       unregister_chrdev(QIC02_TAPE_MAJOR, TPQIC02_NAME);
        devfs_find_and_unregister(NULL, "ntpqic11", QIC02_TAPE_MAJOR, 2,
                                  DEVFS_SPECIAL_CHR, 0);
        devfs_find_and_unregister(NULL, "tpqic11", QIC02_TAPE_MAJOR, 3,
index 210b543954b39a0b339fb666b2e28920d74143f8..370317b2104b535be923803d2bdc3b55707713d9 100644 (file)
@@ -2070,7 +2070,7 @@ int tty_register_driver(struct tty_driver *driver)
        if (driver->flags & TTY_DRIVER_INSTALLED)
                return 0;
 
-       error = devfs_register_chrdev(driver->major, driver->name, &tty_fops);
+       error = register_chrdev(driver->major, driver->name, &tty_fops);
        if (error < 0)
                return error;
        else if(driver->major == 0)
@@ -2117,11 +2117,11 @@ int tty_unregister_driver(struct tty_driver *driver)
                return -ENOENT;
 
        if (othername == NULL) {
-               retval = devfs_unregister_chrdev(driver->major, driver->name);
+               retval = unregister_chrdev(driver->major, driver->name);
                if (retval)
                        return retval;
        } else
-               devfs_register_chrdev(driver->major, othername, &tty_fops);
+               register_chrdev(driver->major, othername, &tty_fops);
 
        if (driver->prev)
                driver->prev->next = driver->next;
index ecc1d318bf8012b44da14e9a8a163bd526cd3c5e..b74049de43c39c63a547556a8ff74c4b02a5fb9f 100644 (file)
@@ -501,7 +501,7 @@ int __init vcs_init(void)
 {
        int error;
 
-       error = devfs_register_chrdev(VCS_MAJOR, "vcs", &vcs_fops);
+       error = register_chrdev(VCS_MAJOR, "vcs", &vcs_fops);
 
        if (error)
                printk("unable to get major %d for vcs device", VCS_MAJOR);
index 24d4fff6383a85c0e5c6adbcc9dede1c2d61d0c1..a6b93f4c580f009c821a260fd0e44962a05552b3 100644 (file)
@@ -489,11 +489,7 @@ int __init i2c_dev_init(void)
        printk(KERN_INFO "i2c-dev.o: i2c /dev entries driver module version %s (%s)\n", I2C_VERSION, I2C_DATE);
 
        i2cdev_initialized = 0;
-#ifdef CONFIG_DEVFS_FS
-       if (devfs_register_chrdev(I2C_MAJOR, "i2c", &i2cdev_fops)) {
-#else
        if (register_chrdev(I2C_MAJOR,"i2c",&i2cdev_fops)) {
-#endif
                printk(KERN_ERR "i2c-dev.o: unable to get major %d for i2c bus\n",
                       I2C_MAJOR);
                return -EIO;
@@ -528,10 +524,8 @@ int i2cdev_cleanup(void)
        if (i2cdev_initialized >= 1) {
 #ifdef CONFIG_DEVFS_FS
                devfs_unregister(devfs_handle);
-               if ((res = devfs_unregister_chrdev(I2C_MAJOR, "i2c"))) {
-#else
-               if ((res = unregister_chrdev(I2C_MAJOR,"i2c"))) {
 #endif
+               if ((res = unregister_chrdev(I2C_MAJOR,"i2c"))) {
                        printk(KERN_ERR "i2c-dev.o: unable to release major %d for i2c bus\n",
                               I2C_MAJOR);
                        return res;
index 4dc463ba33fa33d4df703e9d31f34df3ae04751b..359d99f08019078bd0ea5ab641a4139a64272cff 100644 (file)
@@ -5911,7 +5911,7 @@ static int idetape_cleanup(struct ata_device *drive)
        for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++)
                if (idetape_chrdevs[minor].drive != NULL)
                        return 0;
-       devfs_unregister_chrdev (IDETAPE_MAJOR, "ht");
+       unregister_chrdev (IDETAPE_MAJOR, "ht");
        idetape_chrdev_present = 0;
        return 0;
 }
@@ -5973,7 +5973,7 @@ static void idetape_attach(struct ata_device *drive)
                        idetape_chrdevs[minor].drive = NULL;
 
        if (!idetape_chrdev_present &&
-           devfs_register_chrdev (IDETAPE_MAJOR, "ht", &idetape_fops)) {
+           register_chrdev (IDETAPE_MAJOR, "ht", &idetape_fops)) {
                printk(KERN_ERR "ide-tape: Failed to register character device interface\n");
                return;
        }
@@ -6017,7 +6017,7 @@ static void idetape_attach(struct ata_device *drive)
        supported++;
 
        if (!idetape_chrdev_present && !supported) {
-               devfs_unregister_chrdev (IDETAPE_MAJOR, "ht");
+               unregister_chrdev (IDETAPE_MAJOR, "ht");
        } else
                idetape_chrdev_present = 1;
 
index 6f3d59aafe0496bb8bcd934e1a84dafd11e45568..faf9232383a6fc0e705eb59d88fa5a7fb6695b3d 100644 (file)
@@ -820,7 +820,7 @@ static int __init input_init(void)
        entry = create_proc_read_entry("handlers", 0, proc_bus_input_dir, input_handlers_read, NULL);
        entry->owner = THIS_MODULE;
 #endif
-       if (devfs_register_chrdev(INPUT_MAJOR, "input", &input_fops)) {
+       if (register_chrdev(INPUT_MAJOR, "input", &input_fops)) {
                printk(KERN_ERR "input: unable to register char major %d", INPUT_MAJOR);
                return -EBUSY;
        }
@@ -838,7 +838,7 @@ static void __exit input_exit(void)
        remove_proc_entry("input", proc_bus);
 #endif
        devfs_unregister(input_devfs_handle);
-        if (devfs_unregister_chrdev(INPUT_MAJOR, "input"))
+        if (unregister_chrdev(INPUT_MAJOR, "input"))
                 printk(KERN_ERR "input: can't unregister char major %d", INPUT_MAJOR);
 }
 
index 2b223a22c5b776a8cb085293a0d3af7fb3c8a7de..c604585281873b85aa1781f865b4117bf536d2b4 100644 (file)
@@ -1485,7 +1485,7 @@ static int __init capi_init(void)
        } else
                strcpy(rev, "1.0");
 
-       if (devfs_register_chrdev(capi_major, "capi20", &capi_fops)) {
+       if (register_chrdev(capi_major, "capi20", &capi_fops)) {
                printk(KERN_ERR "capi20: unable to get major %d\n", capi_major);
                MOD_DEC_USE_COUNT;
                return -EIO;
@@ -1498,7 +1498,7 @@ static int __init capi_init(void)
 
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
        if (capinc_tty_init() < 0) {
-               devfs_unregister_chrdev(capi_major, "capi20");
+               unregister_chrdev(capi_major, "capi20");
                MOD_DEC_USE_COUNT;
                return -ENOMEM;
        }
@@ -1526,7 +1526,7 @@ static void __exit capi_exit(void)
 {
        proc_exit();
 
-       devfs_unregister_chrdev(capi_major, "capi20");
+       unregister_chrdev(capi_major, "capi20");
        devfs_find_and_unregister(NULL, "isdn/capi20", capi_major, 0, DEVFS_SPECIAL_CHR, 0);
 
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
index 5b82bf23537de1e88e957e53b892483f8a0de757..c2a14fa3c981f5a910e10fa2e28dfe52d8d0291d 100644 (file)
@@ -2266,7 +2266,7 @@ static int __init isdn_init(void)
                init_waitqueue_head(&dev->mdm.info[i].open_wait);
                init_waitqueue_head(&dev->mdm.info[i].close_wait);
        }
-       if (devfs_register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) {
+       if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) {
                printk(KERN_WARNING "isdn: Could not register control devices\n");
                vfree(dev);
                return -EIO;
@@ -2280,7 +2280,7 @@ static int __init isdn_init(void)
                        tty_unregister_driver(&dev->mdm.tty_modem);
                vfree(dev);
                isdn_cleanup_devfs();
-               devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
+               unregister_chrdev(ISDN_MAJOR, "isdn");
                return -EIO;
        }
 #ifdef CONFIG_ISDN_PPP
@@ -2291,7 +2291,7 @@ static int __init isdn_init(void)
                for (i = 0; i < ISDN_MAX_CHANNELS; i++)
                        kfree(dev->mdm.info[i].xmit_buf - 4);
                isdn_cleanup_devfs();
-               devfs_unregister_chrdev(ISDN_MAJOR, "isdn");
+               unregister_chrdev(ISDN_MAJOR, "isdn");
                vfree(dev);
                return -EIO;
        }
@@ -2354,7 +2354,7 @@ static void __exit isdn_exit(void)
                kfree(dev->mdm.info[i].fax);
 #endif
        }
-       if (devfs_unregister_chrdev(ISDN_MAJOR, "isdn") != 0) {
+       if (unregister_chrdev(ISDN_MAJOR, "isdn") != 0) {
                printk(KERN_WARNING "isdn: controldevice busy, remove cancelled\n");
                restore_flags(flags);
        } else {
index 4280eaf5897a79d5c12a98762ce73c84af5ea94d..f173a8c97e6b52a512ab4f09c8be47a7dbd46e1d 100644 (file)
@@ -815,7 +815,7 @@ static struct file_operations adb_fops = {
 static void
 adbdev_init(void)
 {
-       if (devfs_register_chrdev(ADB_MAJOR, "adb", &adb_fops))
+       if (register_chrdev(ADB_MAJOR, "adb", &adb_fops))
                printk(KERN_ERR "adb: unable to get major %d\n", ADB_MAJOR);
        else
                devfs_register (NULL, "adb", DEVFS_FL_DEFAULT,
index ab05b01ee4ced35617997e6eec855ef111effaf9..f3e98983fe155b03861779bf37a9aac28a0eb5cd 100644 (file)
@@ -388,9 +388,9 @@ static struct gendisk lvm_gendisk =
  */
 int lvm_init(void)
 {
-       if (devfs_register_chrdev(LVM_CHAR_MAJOR,
+       if (register_chrdev(LVM_CHAR_MAJOR,
                                  lvm_name, &lvm_chr_fops) < 0) {
-               printk(KERN_ERR "%s -- devfs_register_chrdev failed\n",
+               printk(KERN_ERR "%s -- register_chrdev failed\n",
                       lvm_name);
                return -EIO;
        }
@@ -398,9 +398,9 @@ int lvm_init(void)
        if (devfs_register_blkdev(MAJOR_NR, lvm_name, &lvm_blk_dops) < 0)
        {
                printk("%s -- devfs_register_blkdev failed\n", lvm_name);
-               if (devfs_unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
+               if (unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
                        printk(KERN_ERR
-                              "%s -- devfs_unregister_chrdev failed\n",
+                              "%s -- unregister_chrdev failed\n",
                               lvm_name);
                return -EIO;
        }
@@ -442,8 +442,8 @@ int lvm_init(void)
  */
 static void lvm_cleanup(void)
 {
-       if (devfs_unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
-               printk(KERN_ERR "%s -- devfs_unregister_chrdev failed\n",
+       if (unregister_chrdev(LVM_CHAR_MAJOR, lvm_name) < 0)
+               printk(KERN_ERR "%s -- unregister_chrdev failed\n",
                       lvm_name);
        if (devfs_unregister_blkdev(MAJOR_NR, lvm_name) < 0)
                printk(KERN_ERR "%s -- devfs_unregister_blkdev failed\n",
index 1357c418d2a74fae4d6676a7b3bc055b79292bd5..ead0e3dc5ee269fd5e928eac779ff0c5668b789f 100644 (file)
@@ -484,8 +484,7 @@ static struct file_operations video_fops=
 static int __init videodev_init(void)
 {
        printk(KERN_INFO "Linux video capture interface: v1.00\n");
-       if(devfs_register_chrdev(VIDEO_MAJOR,"video_capture", &video_fops))
-       {
+       if (register_chrdev(VIDEO_MAJOR,"video_capture", &video_fops)) {
                printk("video_dev: unable to get major %d\n", VIDEO_MAJOR);
                return -EIO;
        }
@@ -502,7 +501,7 @@ static void __exit videodev_exit(void)
 #if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
        videodev_proc_destroy ();
 #endif
-       devfs_unregister_chrdev(VIDEO_MAJOR, "video_capture");
+       unregister_chrdev(VIDEO_MAJOR, "video_capture");
 }
 
 module_init(videodev_init)
index 03404e440728940046a470041e51739476fcaead..5b1fa29adc25027f198a2e297e65bddc8ce6a9b1 100644 (file)
@@ -494,26 +494,17 @@ static void mtd_notify_remove(struct mtd_info* mtd)
 
 static int __init init_mtdchar(void)
 {
-#ifdef CONFIG_DEVFS_FS
-       if (devfs_register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
-       {
+       if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops)) {
                printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
                       MTD_CHAR_MAJOR);
                return -EAGAIN;
        }
 
+#ifdef CONFIG_DEVFS_FS
        devfs_dir_handle = devfs_mk_dir(NULL, "mtd", NULL);
 
        register_mtd_user(&notifier);
-#else
-       if (register_chrdev(MTD_CHAR_MAJOR, "mtd", &mtd_fops))
-       {
-               printk(KERN_NOTICE "Can't allocate major number %d for Memory Technology Devices.\n",
-                      MTD_CHAR_MAJOR);
-               return -EAGAIN;
-       }
 #endif
-
        return 0;
 }
 
@@ -522,10 +513,8 @@ static void __exit cleanup_mtdchar(void)
 #ifdef CONFIG_DEVFS_FS
        unregister_mtd_user(&notifier);
        devfs_unregister(devfs_dir_handle);
-       devfs_unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
-#else
-       unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
 #endif
+       unregister_chrdev(MTD_CHAR_MAJOR, "mtd");
 }
 
 module_init(init_mtdchar);
index 770e415c2b187d36979b14c2e0134e8dbc2a22f6..10928840e3c9c6865ff7b26b445668ea0d432c0c 100644 (file)
@@ -785,7 +785,7 @@ int __init ppp_init(void)
        int err;
 
        printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
-       err = devfs_register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
+       err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
        if (err)
                printk(KERN_ERR "failed to register PPP device (%d)\n", err);
        devfs_handle = devfs_register(NULL, "ppp", DEVFS_FL_DEFAULT,
@@ -2509,7 +2509,7 @@ static void __exit ppp_cleanup(void)
        if (atomic_read(&ppp_unit_count) || atomic_read(&channel_count))
                printk(KERN_ERR "PPP: removing module but units remain!\n");
        cardmap_destroy(&all_ppp_units);
-       if (devfs_unregister_chrdev(PPP_MAJOR, "ppp") != 0)
+       if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
                printk(KERN_ERR "PPP: failed to unregister PPP device\n");
        devfs_unregister(devfs_handle);
 }
index 30af146bb9724a2bbcd2a759aedcb5e2b2759abd..4730a342d23c569bee46ed8e9639456882a1f043 100644 (file)
@@ -373,13 +373,13 @@ static int __init cosa_init(void)
        printk(KERN_INFO "cosa: SMP found. Please mail any success/failure reports to the author.\n");
 #endif
        if (cosa_major > 0) {
-               if (devfs_register_chrdev(cosa_major, "cosa", &cosa_fops)) {
+               if (register_chrdev(cosa_major, "cosa", &cosa_fops)) {
                        printk(KERN_WARNING "cosa: unable to get major %d\n",
                                cosa_major);
                        return -EIO;
                }
        } else {
-               if (!(cosa_major=devfs_register_chrdev(0, "cosa", &cosa_fops))) {
+               if (!(cosa_major=register_chrdev(0, "cosa", &cosa_fops))) {
                        printk(KERN_WARNING "cosa: unable to register chardev\n");
                        return -EIO;
                }
@@ -395,7 +395,7 @@ static int __init cosa_init(void)
                               &cosa_fops, NULL);
        if (!nr_cards) {
                printk(KERN_WARNING "cosa: no devices found.\n");
-               devfs_unregister_chrdev(cosa_major, "cosa");
+               unregister_chrdev(cosa_major, "cosa");
                return -ENODEV;
        }
        return 0;
@@ -422,7 +422,7 @@ void cleanup_module (void)
                free_dma(cosa->dma);
                release_region(cosa->datareg,is_8bit(cosa)?2:4);
        }
-       devfs_unregister_chrdev(cosa_major, "cosa");
+       unregister_chrdev(cosa_major, "cosa");
 }
 #endif
 
index 1c5e6efd655a93999a23500eb1acb552a76a4a27..98c82f1522a4f7a36283eea43c14ced595d9d2ff 100644 (file)
@@ -128,11 +128,7 @@ tapechar_init (void)
        tape_init();
 
        /* Register the tape major number to the kernel */
-#ifdef CONFIG_DEVFS_FS
-       result = devfs_register_chrdev (tapechar_major, "tape", &tape_fops);
-#else
        result = register_chrdev (tapechar_major, "tape", &tape_fops);
-#endif
        if (result < 0) {
                PRINT_WARN (KERN_ERR "tape: can't get major %d\n", tapechar_major);
                tape_sprintf_event (tape_dbf_area,3,"c:initfail\n");
@@ -178,11 +174,7 @@ tapechar_init (void)
 void
 tapechar_uninit (void)
 {
-#ifdef CONFIG_DEVFS_FS
-       devfs_unregister_chrdev (tapechar_major, "tape");
-#else
        unregister_chrdev (tapechar_major, "tape");
-#endif
 }
 
 
index c50e34830676647c7e8142b408281e191d0c4bfc..8486d77a4d8c2f549e416649ab3df51fd456ee32 100644 (file)
@@ -74,26 +74,19 @@ fs3270_init(void)
 {
        int rc;
 
-#ifdef CONFIG_DEVFS_FS
-       rc = devfs_register_chrdev (IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
+       rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
        if (rc) {
                printk(KERN_ERR "tubmod can't get major nbr %d: error %d\n",
                        IBM_FS3270_MAJOR, rc);
                return -1;
        }
+#ifdef CONFIG_DEVFS_FS
        fs3270_devfs_dir = devfs_mk_dir(NULL, "3270", NULL);
        fs3270_devfs_tub = 
                devfs_register(fs3270_devfs_dir, "tub", DEVFS_FL_DEFAULT,
                               IBM_FS3270_MAJOR, 0,
                               S_IFCHR | S_IRUGO | S_IWUGO, 
                               &fs3270_fops, NULL);
-#else
-       rc = register_chrdev(IBM_FS3270_MAJOR, "fs3270", &fs3270_fops);
-       if (rc) {
-               printk(KERN_ERR "tubmod can't get major nbr %d: error %d\n",
-                       IBM_FS3270_MAJOR, rc);
-               return -1;
-       }
 #endif
        fs3270_major = IBM_FS3270_MAJOR;
        return 0;
index b83fa77ee48eb06e3f565732d03f8740ed97706a..4b90c394f379a9a3b1dff3452c2b5e9d5ee966ff 100644 (file)
@@ -2123,7 +2123,7 @@ EXPORT_SYMBOL(sparcaudio_input_done);
 static int __init sparcaudio_init(void)
 {
        /* Register our character device driver with the VFS. */
-       if (devfs_register_chrdev(SOUND_MAJOR, "sparcaudio", &sparcaudio_fops))
+       if (register_chrdev(SOUND_MAJOR, "sparcaudio", &sparcaudio_fops))
                return -EIO;
 
        devfs_handle = devfs_mk_dir (NULL, "sound", NULL);
@@ -2132,7 +2132,7 @@ static int __init sparcaudio_init(void)
 
 static void __exit sparcaudio_exit(void)
 {
-       devfs_unregister_chrdev(SOUND_MAJOR, "sparcaudio");
+       unregister_chrdev(SOUND_MAJOR, "sparcaudio");
        devfs_unregister (devfs_handle);
 }
 
index 5ed0a0c90ad20151beac301d3367f92e4779500f..00bce39b7cda45cef541123ec605e0fc672993d1 100644 (file)
@@ -1041,7 +1041,7 @@ static int __init bpp_init(void)
        if (rc == 0)
                return -ENODEV;
 
-       rc = devfs_register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
+       rc = register_chrdev(BPP_MAJOR, dev_name, &bpp_fops);
        if (rc < 0)
                return rc;
 
@@ -1062,7 +1062,7 @@ static void __exit bpp_cleanup(void)
        unsigned idx;
 
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev(BPP_MAJOR, dev_name);
+       unregister_chrdev(BPP_MAJOR, dev_name);
 
        for (idx = 0 ;  idx < BPP_NO ;  idx += 1) {
                if (instances[idx].present)
index 6d150d928e30c0c87ed53bd4d7e59f2be99bcc7e..9f919c59036bf9053e4d2fa0e11c5a87fa18a014 100644 (file)
@@ -1615,7 +1615,7 @@ void __init keyboard_zsinit(void (*put_char)(unsigned char))
                        KBD_MAJOR, 0,
                        S_IFCHR | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
                        &kbd_fops, NULL);
-       if (devfs_register_chrdev (KBD_MAJOR, "kbd", &kbd_fops)){
+       if (register_chrdev (KBD_MAJOR, "kbd", &kbd_fops)){
                printk ("Could not register /dev/kbd device\n");
                return;
        }
index ea3894bd233c10bd924eed0042a237c137e4a0dd..9b6d4836e5f3a7330c029639b4c172c0898bd345 100644 (file)
@@ -676,7 +676,7 @@ static int vfc_probe(void)
        memset(vfc_dev_lst, 0, sizeof(struct vfc_dev *) * (cards + 1));
        vfc_dev_lst[cards] = NULL;
 
-       ret = devfs_register_chrdev(VFC_MAJOR, vfcstr, &vfc_fops);
+       ret = register_chrdev(VFC_MAJOR, vfcstr, &vfc_fops);
        if(ret) {
                printk(KERN_ERR "Unable to get major number %d\n", VFC_MAJOR);
                kfree(vfc_dev_lst);
@@ -732,7 +732,7 @@ void cleanup_module(void)
 {
        struct vfc_dev **devp;
 
-       devfs_unregister_chrdev(VFC_MAJOR,vfcstr);
+       unregister_chrdev(VFC_MAJOR,vfcstr);
 
        for (devp = vfc_dev_lst; *devp; devp++)
                deinit_vfc_device(*devp);
index 9ea4f1b68ca737d7d7a2a39c827ce8ed06731c0b..fc5f5aa2f1bb93867257e3f07d3337cdac8213ac 100644 (file)
@@ -5585,11 +5585,7 @@ static int osst_init()
   if (osst_template.dev_noticed == 0) return 0;
 
   if(!osst_registered) {
-#ifdef CONFIG_DEVFS_FS
-       if (devfs_register_chrdev(MAJOR_NR,"osst",&osst_fops)) {
-#else
        if (register_chrdev(MAJOR_NR,"osst",&osst_fops)) {
-#endif
                printk(KERN_ERR "osst :W: Unable to get major %d for OnStream tapes\n",MAJOR_NR);
                return 1;
        }
@@ -5605,11 +5601,7 @@ static int osst_init()
                                   GFP_ATOMIC);
   if (os_scsi_tapes == NULL) {
        printk(KERN_ERR "osst :W: Unable to allocate array for OnStream SCSI tapes.\n");
-#ifdef CONFIG_DEVFS_FS
-       devfs_unregister_chrdev(MAJOR_NR, "osst");
-#else
        unregister_chrdev(MAJOR_NR, "osst");
-#endif
        return 1;
   }
 
@@ -5621,11 +5613,7 @@ static int osst_init()
                                    GFP_ATOMIC);
   if (osst_buffers == NULL) {
        printk(KERN_ERR "osst :W: Unable to allocate tape buffer pointers.\n");
-#ifdef CONFIG_DEVFS_FS
-       devfs_unregister_chrdev(MAJOR_NR, "osst");
-#else
        unregister_chrdev(MAJOR_NR, "osst");
-#endif
        kfree(os_scsi_tapes);
        return 1;
   }
@@ -5684,11 +5672,7 @@ static void __exit exit_osst (void)
   OS_Scsi_Tape * STp;
 
   scsi_unregister_device(&osst_template);
-#ifdef CONFIG_DEVFS_FS
-  devfs_unregister_chrdev(MAJOR_NR, "osst");
-#else
   unregister_chrdev(MAJOR_NR, "osst");
-#endif
   osst_registered--;
   if(os_scsi_tapes != NULL) {
        for (i=0; i < osst_template.dev_max; ++i) {
index c4a0e90de737eb8306c51a9cbaa45b2e6b30cba8..f77086e3a42e4c66b16e2a20b90cbd6096d49d36 100644 (file)
@@ -1348,8 +1348,7 @@ static int sg_init()
 
     write_lock_irqsave(&sg_dev_arr_lock, iflags);
     if(!sg_registered) {
-       if (devfs_register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops))
-        {
+       if (register_chrdev(SCSI_GENERIC_MAJOR,"sg",&sg_fops)) {
             printk(KERN_ERR "Unable to get major %d for generic SCSI device\n",
                    SCSI_GENERIC_MAJOR);
            write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
@@ -1611,7 +1610,7 @@ static void __exit exit_sg( void)
     sg_proc_cleanup();
 #endif  /* CONFIG_PROC_FS */
     scsi_unregister_device(&sg_template);
-    devfs_unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
+    unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
     if(sg_dev_arr != NULL) {
        kfree((char *)sg_dev_arr);
         sg_dev_arr = NULL;
index 9ba9b04048ba1c78e5ef9ff4d5ca99193b077d6e..c2ef2a258a8fb4ddaeb4d2da81115e62a0521c73 100644 (file)
@@ -3826,7 +3826,7 @@ static int __init init_st(void)
                verstr, st_fixed_buffer_size, st_write_threshold,
                st_max_sg_segs);
 
-       if (devfs_register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) {
+       if (register_chrdev(SCSI_TAPE_MAJOR, "st", &st_fops) >= 0) {
                if (scsi_register_device(&st_template) == 0) {
                        st_template.scsi_driverfs_driver.name = 
                                (char *)st_template.tag;
@@ -3846,7 +3846,7 @@ static void __exit exit_st(void)
        int i;
 
        scsi_unregister_device(&st_template);
-       devfs_unregister_chrdev(SCSI_TAPE_MAJOR, "st");
+       unregister_chrdev(SCSI_TAPE_MAJOR, "st");
        if (scsi_tapes != NULL) {
                for (i=0; i < st_template.dev_max; ++i)
                        if (scsi_tapes[i])
index 0533e7c64becda0d40e5ca18287734ae44c24d58..b8dd324f0cd6e0f06888c3f43a4969d13953ef39 100644 (file)
@@ -466,7 +466,7 @@ void
 shmiq_init (void)
 {
        printk ("SHMIQ setup\n");
-       devfs_register_chrdev(SHMIQ_MAJOR, "shmiq", &shmiq_fops);
+       register_chrdev(SHMIQ_MAJOR, "shmiq", &shmiq_fops);
        devfs_register (NULL, "shmiq", DEVFS_FL_DEFAULT,
                        SHMIQ_MAJOR, 0, S_IFCHR | S_IRUSR | S_IWUSR,
                        &shmiq_fops, NULL);
index 803fb19e5ad21e606cfbea89342424c29341a109..11845a102d1162c7cd90cf7981dc64aa8960f4c8 100644 (file)
@@ -71,7 +71,7 @@ static struct file_operations usb_fops = {
 
 int usb_major_init(void)
 {
-       if (devfs_register_chrdev(USB_MAJOR, "usb", &usb_fops)) {
+       if (register_chrdev(USB_MAJOR, "usb", &usb_fops)) {
                err("unable to get major %d for usb devices", USB_MAJOR);
                return -EBUSY;
        }
@@ -84,7 +84,7 @@ int usb_major_init(void)
 void usb_major_cleanup(void)
 {
        devfs_unregister(usb_devfs_handle);
-       devfs_unregister_chrdev(USB_MAJOR, "usb");
+       unregister_chrdev(USB_MAJOR, "usb");
 }
 
 /**
index 15332a4d3dadbb80aa166363bc8444d742a4c74b..bd9b38810f3c2acaf440c39c1a38b1db3e0d3e43 100644 (file)
@@ -476,7 +476,7 @@ tiglusb_init (void)
        }
 
        /* register device */
-       if (devfs_register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) {
+       if (register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) {
                err ("unable to get major %d", TIUSB_MAJOR);
                return -EIO;
        }
@@ -487,7 +487,7 @@ tiglusb_init (void)
        /* register USB module */
        result = usb_register (&tiglusb_driver);
        if (result < 0) {
-               devfs_unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+               unregister_chrdev (TIUSB_MAJOR, "tiglusb");
                return -1;
        }
 
@@ -501,7 +501,7 @@ tiglusb_cleanup (void)
 {
        usb_deregister (&tiglusb_driver);
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+       unregister_chrdev (TIUSB_MAJOR, "tiglusb");
 }
 
 /* --------------------------------------------------------------------- */
index b0010753f346b3b4a00225e1da89a8558d1ea56a..45f94b158904eeac12e23a44e8da17906c5d991c 100644 (file)
@@ -845,7 +845,7 @@ fbmem_init(void)
        create_proc_read_entry("fb", 0, 0, fbmem_read_proc, NULL);
 
        devfs_handle = devfs_mk_dir (NULL, "fb", NULL);
-       if (devfs_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);
 
 #ifdef CONFIG_FB_OF
index 7929ce018c9660e8d450a4d36380fd762a0728eb..10e45309f7dd388592bb612685333111fa8fe570 100644 (file)
@@ -366,7 +366,7 @@ static devfs_handle_t devfs_handle;
 
 static int init_coda_psdev(void)
 {
-       if(devfs_register_chrdev(CODA_PSDEV_MAJOR,"coda_psdev",
+       if(register_chrdev(CODA_PSDEV_MAJOR,"coda_psdev",
                                 &coda_psdev_fops)) {
               printk(KERN_ERR "coda_psdev: unable to get major %d\n", 
                     CODA_PSDEV_MAJOR);
@@ -411,7 +411,7 @@ static int __init init_coda(void)
        return 0;
 out:
        devfs_unregister(devfs_handle);
-       devfs_unregister_chrdev(CODA_PSDEV_MAJOR,"coda_psdev");
+       unregister_chrdev(CODA_PSDEV_MAJOR,"coda_psdev");
        coda_sysctl_clean();
 out1:
        coda_destroy_inodecache();
@@ -428,7 +428,7 @@ static void __exit exit_coda(void)
                 printk("coda: failed to unregister filesystem\n");
         }
        devfs_unregister(devfs_handle);
-       devfs_unregister_chrdev(CODA_PSDEV_MAJOR, "coda_psdev");
+       unregister_chrdev(CODA_PSDEV_MAJOR, "coda_psdev");
        coda_sysctl_clean();
        coda_destroy_inodecache();
 }
index 0e563abb6802faebf496d2da6e842d2ee24ec619..fc498d624f411768d8ca2adcee81c4615b6ee70b 100644 (file)
@@ -2228,22 +2228,16 @@ const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen)
 
 
 /**
- *     devfs_register_chrdev - Optionally register a conventional character driver.
- *     @major: The major number for the driver.
- *     @name: The name of the driver (as seen in /proc/devices).
- *     @fops: The &file_operations structure pointer.
+ *     devfs_should_register_chrdev - should we register a conventional character driver.
  *
- *     This function will register a character driver provided the "devfs=only"
- *     option was not provided at boot time.
- *     Returns 0 on success, else a negative error code on failure.
+ *     If "devfs=only" this function will return -1, otherwise 0 is returned.
  */
-
-int devfs_register_chrdev (unsigned int major, const char *name,
-                          struct file_operations *fops)
+int devfs_should_register_chrdev (void)
 {
-    if (boot_options & OPTION_ONLY) return 0;
-    return register_chrdev (major, name, fops);
-}   /*  End Function devfs_register_chrdev  */
+    if (boot_options & OPTION_ONLY)
+           return -1;
+    return 0;
+}
 
 
 /**
@@ -2266,20 +2260,16 @@ int devfs_register_blkdev (unsigned int major, const char *name,
 
 
 /**
- *     devfs_unregister_chrdev - Optionally unregister a conventional character driver.
- *     @major: The major number for the driver.
- *     @name: The name of the driver (as seen in /proc/devices).
+ *     devfs_should_unregister_chrdev - should we unregister a conventional character driver.
  *
- *     This function will unregister a character driver provided the "devfs=only"
- *     option was not provided at boot time.
- *     Returns 0 on success, else a negative error code on failure.
+ *     If "devfs=only" this function will return -1, otherwise 0 is returned
  */
-
-int devfs_unregister_chrdev (unsigned int major, const char *name)
+int devfs_should_unregister_chrdev (void)
 {
-    if (boot_options & OPTION_ONLY) return 0;
-    return unregister_chrdev (major, name);
-}   /*  End Function devfs_unregister_chrdev  */
+    if (boot_options & OPTION_ONLY)
+           return -1;
+    return 0;
+}
 
 
 /**
@@ -2385,9 +2375,7 @@ EXPORT_SYMBOL(devfs_get_next_sibling);
 EXPORT_SYMBOL(devfs_auto_unregister);
 EXPORT_SYMBOL(devfs_get_unregister_slave);
 EXPORT_SYMBOL(devfs_get_name);
-EXPORT_SYMBOL(devfs_register_chrdev);
 EXPORT_SYMBOL(devfs_register_blkdev);
-EXPORT_SYMBOL(devfs_unregister_chrdev);
 EXPORT_SYMBOL(devfs_unregister_blkdev);
 
 
index 0447d805a77e5e88dcbe25ed8af60c3af26afcc2..eb242107eacf53c8bc4513027e37f68f21bd424b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/errno.h>
 #include <linux/module.h>
 #include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
 #ifdef CONFIG_KMOD
 #include <linux/kmod.h>
 
@@ -97,6 +98,8 @@ static struct file_operations * get_chrfops(unsigned int major, unsigned int min
 
 int register_chrdev(unsigned int major, const char * name, struct file_operations *fops)
 {
+       if (devfs_should_register_chrdev())
+               return 0;
        if (major == 0) {
                write_lock(&chrdevs_lock);
                for (major = MAX_CHRDEV-1; major > 0; major--) {
@@ -125,6 +128,8 @@ int register_chrdev(unsigned int major, const char * name, struct file_operation
 
 int unregister_chrdev(unsigned int major, const char * name)
 {
+       if (devfs_should_register_chrdev())
+               return 0;
        if (major >= MAX_CHRDEV)
                return -EINVAL;
        write_lock(&chrdevs_lock);
index 3448d862d97688ae1b326320571e21d4847f82b3..e6bd28ef673e85fc38a006d00d0e3735988331de 100644 (file)
@@ -94,11 +94,10 @@ extern devfs_handle_t devfs_get_next_sibling (devfs_handle_t de);
 extern void devfs_auto_unregister (devfs_handle_t master,devfs_handle_t slave);
 extern devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master);
 extern const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen);
-extern int devfs_register_chrdev (unsigned int major, const char *name,
-                                 struct file_operations *fops);
+extern int devfs_should_register_chrdev (void);
 extern int devfs_register_blkdev (unsigned int major, const char *name,
                                  struct block_device_operations *bdops);
-extern int devfs_unregister_chrdev (unsigned int major, const char *name);
+extern int devfs_should_unregister_chrdev (void);
 extern int devfs_unregister_blkdev (unsigned int major, const char *name);
 
 extern void devfs_register_tape (devfs_handle_t de);
@@ -239,19 +238,18 @@ static inline const char *devfs_get_name (devfs_handle_t de,
 {
     return NULL;
 }
-static inline int devfs_register_chrdev (unsigned int major, const char *name,
-                                        struct file_operations *fops)
+static inline int devfs_should_register_chrdev (void)
 {
-    return register_chrdev (major, name, fops);
+    return 0;
 }
 static inline int devfs_register_blkdev (unsigned int major, const char *name,
                                         struct block_device_operations *bdops)
 {
     return register_blkdev (major, name, bdops);
 }
-static inline int devfs_unregister_chrdev (unsigned int major,const char *name)
+static inline int devfs_unregister_chrdev (void)
 {
-    return unregister_chrdev (major, name);
+    return 0;
 }
 static inline int devfs_unregister_blkdev (unsigned int major,const char *name)
 {
index 131209fea01d7bc9c397d8d060a2744200bdec40..f5b4a4294fcfbbd31bfb466830775ee5f9c78183 100644 (file)
@@ -182,7 +182,7 @@ static void __init make_devfs_entries (const char *name, int minor)
 
 int __init init_netlink(void)
 {
-       if (devfs_register_chrdev(NETLINK_MAJOR,"netlink", &netlink_fops)) {
+       if (register_chrdev(NETLINK_MAJOR,"netlink", &netlink_fops)) {
                printk(KERN_ERR "netlink: unable to get major %d\n", NETLINK_MAJOR);
                return -EIO;
        }
@@ -217,7 +217,7 @@ int init_module(void)
 void cleanup_module(void)
 {
        devfs_unregister (devfs_handle);
-       devfs_unregister_chrdev(NETLINK_MAJOR, "netlink");
+       unregister_chrdev(NETLINK_MAJOR, "netlink");
 }
 
 #endif
index 31efb472613c99210a5fe870f4e86fdb3d06c026..ece4af1107e96429c8a03f1844781d08e5f997ea 100644 (file)
@@ -315,10 +315,8 @@ static int __init alsa_sound_init(void)
 #else
        devfs_handle = devfs_mk_dir(NULL, "snd", NULL);
 #endif
-       if (devfs_register_chrdev(snd_major, "alsa", &snd_fops)) {
-#else
-       if (register_chrdev(snd_major, "alsa", &snd_fops)) {
 #endif
+       if (register_chrdev(snd_major, "alsa", &snd_fops)) {
                snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major);
 #ifdef CONFIG_SND_OSSEMUL
                snd_oss_cleanup_module();
@@ -386,11 +384,7 @@ static void __exit alsa_sound_exit(void)
 #ifdef CONFIG_SND_DEBUG_MEMORY
        snd_memory_done();
 #endif
-#ifdef CONFIG_DEVFS_FS
-       if (devfs_unregister_chrdev(snd_major, "alsa") != 0)
-#else
        if (unregister_chrdev(snd_major, "alsa") != 0)
-#endif
                snd_printk(KERN_ERR "unable to unregister major device number %d\n", snd_major);
 #ifdef CONFIG_DEVFS_FS
        devfs_unregister(devfs_handle);
index 3616220d1b5e7e7fd101c551e08230f1a46dc2c8..8110a6f19205b08cf6e31bf0d4067d3f1d7037f2 100644 (file)
@@ -554,14 +554,13 @@ static void __exit cleanup_soundcore(void)
 {
        /* We have nothing to really do here - we know the lists must be
           empty */
-       devfs_unregister_chrdev(SOUND_MAJOR, "sound");
+       unregister_chrdev(SOUND_MAJOR, "sound");
        devfs_unregister (devfs_handle);
 }
 
 static int __init init_soundcore(void)
 {
-       if(devfs_register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1)
-       {
+       if (register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1) {
                printk(KERN_ERR "soundcore: sound device already in use.\n");
                return -EBUSY;
        }