Use register_chrdev and unregister_chrdev as before, and everything will work.
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,
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;
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);
}
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;
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 );
}
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++)
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);
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++)
{
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);
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;
}
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);
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;
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);
}
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];
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");
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);
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 */
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)
* 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");
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;
}
#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;
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();
#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;
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;
{
/* Clean up all parport stuff */
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev (PP_MAJOR, CHRDEV);
+ unregister_chrdev (PP_MAJOR, CHRDEV);
}
module_init(ppdev_init);
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);
* 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,
#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);
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,
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)
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;
{
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);
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;
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;
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;
}
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;
}
supported++;
if (!idetape_chrdev_present && !supported) {
- devfs_unregister_chrdev (IDETAPE_MAJOR, "ht");
+ unregister_chrdev (IDETAPE_MAJOR, "ht");
} else
idetape_chrdev_present = 1;
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;
}
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);
}
} 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;
#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;
}
{
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
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;
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
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;
}
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 {
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,
*/
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;
}
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;
}
*/
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",
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;
}
#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)
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(¬ifier);
-#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;
}
#ifdef CONFIG_DEVFS_FS
unregister_mtd_user(¬ifier);
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);
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,
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);
}
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;
}
&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;
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
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");
void
tapechar_uninit (void)
{
-#ifdef CONFIG_DEVFS_FS
- devfs_unregister_chrdev (tapechar_major, "tape");
-#else
unregister_chrdev (tapechar_major, "tape");
-#endif
}
{
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;
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);
static void __exit sparcaudio_exit(void)
{
- devfs_unregister_chrdev(SOUND_MAJOR, "sparcaudio");
+ unregister_chrdev(SOUND_MAJOR, "sparcaudio");
devfs_unregister (devfs_handle);
}
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;
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)
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;
}
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);
{
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);
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;
}
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;
}
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;
}
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) {
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);
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;
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;
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])
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);
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;
}
void usb_major_cleanup(void)
{
devfs_unregister(usb_devfs_handle);
- devfs_unregister_chrdev(USB_MAJOR, "usb");
+ unregister_chrdev(USB_MAJOR, "usb");
}
/**
}
/* 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;
}
/* register USB module */
result = usb_register (&tiglusb_driver);
if (result < 0) {
- devfs_unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+ unregister_chrdev (TIUSB_MAJOR, "tiglusb");
return -1;
}
{
usb_deregister (&tiglusb_driver);
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev (TIUSB_MAJOR, "tiglusb");
+ unregister_chrdev (TIUSB_MAJOR, "tiglusb");
}
/* --------------------------------------------------------------------- */
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
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);
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();
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();
}
/**
- * 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;
+}
/**
/**
- * 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;
+}
/**
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);
#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>
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--) {
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);
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);
{
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)
{
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;
}
void cleanup_module(void)
{
devfs_unregister (devfs_handle);
- devfs_unregister_chrdev(NETLINK_MAJOR, "netlink");
+ unregister_chrdev(NETLINK_MAJOR, "netlink");
}
#endif
#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();
#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);
{
/* 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;
}