Skip to content

Commit

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

Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jun 26, 2006
1 parent 1a715c5 commit 7c69ef7
Show file tree
Hide file tree
Showing 35 changed files with 8 additions and 202 deletions.
2 changes: 0 additions & 2 deletions arch/sparc64/solaris/socksys.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ init_socksys(void)
return ret;
}

devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUSR|S_IWUSR, "socksys");

file = fcheck(ret);
/* N.B. Is this valid? Suppose the f_ops are in a module ... */
socksys_file_ops = *file->f_op;
Expand Down
4 changes: 0 additions & 4 deletions drivers/block/acsi_slm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,6 @@ int slm_init( void )
BufferP = SLMBuffer;
SLMState = IDLE;

for (i = 0; i < MAX_SLM; i++) {
devfs_mk_cdev(MKDEV(ACSI_MAJOR, i),
S_IFCHR|S_IRUSR|S_IWUSR, "slm/%d", i);
}
return 0;
}

Expand Down
11 changes: 1 addition & 10 deletions drivers/block/paride/pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,22 +676,13 @@ static int __init pg_init(void)
}
for (unit = 0; unit < PG_UNITS; unit++) {
struct pg *dev = &devices[unit];
if (dev->present) {
if (dev->present)
class_device_create(pg_class, NULL, MKDEV(major, unit),
NULL, "pg%u", unit);
err = devfs_mk_cdev(MKDEV(major, unit),
S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u",
unit);
if (err)
goto out_class;
}
}
err = 0;
goto out;

out_class:
class_device_destroy(pg_class, MKDEV(major, unit));
class_destroy(pg_class);
out_chrdev:
unregister_chrdev(major, "pg");
out:
Expand Down
16 changes: 0 additions & 16 deletions drivers/block/paride/pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -975,27 +975,11 @@ static int __init pt_init(void)
if (pt[unit].present) {
class_device_create(pt_class, NULL, MKDEV(major, unit),
NULL, "pt%d", unit);
err = devfs_mk_cdev(MKDEV(major, unit),
S_IFCHR | S_IRUSR | S_IWUSR,
"pt/%d", unit);
if (err) {
class_device_destroy(pt_class, MKDEV(major, unit));
goto out_class;
}
class_device_create(pt_class, NULL, MKDEV(major, unit + 128),
NULL, "pt%dn", unit);
err = devfs_mk_cdev(MKDEV(major, unit + 128),
S_IFCHR | S_IRUSR | S_IWUSR,
"pt/%dn", unit);
if (err) {
class_device_destroy(pt_class, MKDEV(major, unit + 128));
goto out_class;
}
}
goto out;

out_class:
class_destroy(pt_class);
out_chrdev:
unregister_chrdev(major, "pt");
out:
Expand Down
8 changes: 0 additions & 8 deletions drivers/char/dsp56k.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,17 +518,9 @@ static int __init dsp56k_init_driver(void)
}
class_device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k");

err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0),
S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k");
if(err)
goto out_class;

printk(banner);
goto out;

out_class:
class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
class_destroy(dsp56k_class);
out_chrdev:
unregister_chrdev(DSP56K_MAJOR, "dsp56k");
out:
Expand Down
3 changes: 0 additions & 3 deletions drivers/char/dtlk.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,6 @@ static int __init dtlk_init(void)
if (dtlk_dev_probe() == 0)
printk(", MAJOR %d\n", dtlk_major);

devfs_mk_cdev(MKDEV(dtlk_major, DTLK_MINOR),
S_IFCHR | S_IRUSR | S_IWUSR, "dtlk");

init_timer(&dtlk_timer);
dtlk_timer.function = dtlk_timer_tick;
init_waitqueue_head(&dtlk_process_list);
Expand Down
18 changes: 0 additions & 18 deletions drivers/char/ftape/zftape/zftape-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,29 +332,11 @@ KERN_INFO
zft_class = class_create(THIS_MODULE, "zft");
for (i = 0; i < 4; i++) {
class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i);
devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i),
S_IFCHR | S_IRUSR | S_IWUSR,
"qft%i", i);
class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i);
devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4),
S_IFCHR | S_IRUSR | S_IWUSR,
"nqft%i", i);
class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i);
devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16),
S_IFCHR | S_IRUSR | S_IWUSR,
"zqft%i", i);
class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i);
devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20),
S_IFCHR | S_IRUSR | S_IWUSR,
"nzqft%i", i);
class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i);
devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32),
S_IFCHR | S_IRUSR | S_IWUSR,
"rawqft%i", i);
class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i);
devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36),
S_IFCHR | S_IRUSR | S_IWUSR,
"nrawqft%i", i);
}

#ifdef CONFIG_ZFT_COMPRESSOR
Expand Down
17 changes: 0 additions & 17 deletions drivers/char/ip2/ip2main.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,26 +724,9 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
class_device_create(ip2_class, NULL,
MKDEV(IP2_IPL_MAJOR, 4 * i),
NULL, "ipl%d", i);
err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i),
S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
"ip2/ipl%d", i);
if (err) {
class_device_destroy(ip2_class,
MKDEV(IP2_IPL_MAJOR, 4 * i));
goto out_class;
}

class_device_create(ip2_class, NULL,
MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
NULL, "stat%d", i);
err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR,
"ip2/stat%d", i);
if (err) {
class_device_destroy(ip2_class,
MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
goto out_class;
}

for ( box = 0; box < ABS_MAX_BOXES; ++box )
{
Expand Down
3 changes: 0 additions & 3 deletions drivers/char/ipmi/ipmi_devintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,6 @@ static void ipmi_new_smi(int if_num, struct device *device)
dev_t dev = MKDEV(ipmi_major, if_num);
struct ipmi_reg_list *entry;

devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
"ipmidev/%d", if_num);

entry = kmalloc(sizeof(*entry), GFP_KERNEL);
if (!entry) {
printk(KERN_ERR "ipmi_devintf: Unable to create the"
Expand Down
6 changes: 1 addition & 5 deletions drivers/char/istallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -5214,14 +5214,10 @@ int __init stli_init(void)
"device\n");

istallion_class = class_create(THIS_MODULE, "staliomem");
for (i = 0; i < 4; i++) {
devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
S_IFCHR | S_IRUSR | S_IWUSR,
"staliomem/%d", i);
for (i = 0; i < 4; i++)
class_device_create(istallion_class, NULL,
MKDEV(STL_SIOMEMMAJOR, i),
NULL, "staliomem%d", i);
}

/*
* Set up the tty driver structure and register us as a driver.
Expand Down
2 changes: 0 additions & 2 deletions drivers/char/lp.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,6 @@ static int lp_register(int nr, struct parport *port)

class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), NULL,
"lp%d", nr);
devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
"printers/%d", nr);

printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name,
(port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");
Expand Down
5 changes: 1 addition & 4 deletions drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,13 +941,10 @@ static int __init chr_dev_init(void)
printk("unable to get major %d for memory devs\n", MEM_MAJOR);

mem_class = class_create(THIS_MODULE, "mem");
for (i = 0; i < ARRAY_SIZE(devlist); i++) {
for (i = 0; i < ARRAY_SIZE(devlist); i++)
class_device_create(mem_class, NULL,
MKDEV(MEM_MAJOR, devlist[i].minor),
NULL, devlist[i].name);
devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor),
S_IFCHR | devlist[i].mode, devlist[i].name);
}

return 0;
}
Expand Down
9 changes: 1 addition & 8 deletions drivers/char/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ int misc_register(struct miscdevice * misc)
{
struct miscdevice *c;
dev_t dev;
int err;
int err = 0;

down(&misc_sem);
list_for_each_entry(c, &misc_list, list) {
Expand Down Expand Up @@ -241,13 +241,6 @@ int misc_register(struct miscdevice * misc)
goto out;
}

err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,
misc->devfs_name);
if (err) {
class_device_destroy(misc_class, dev);
goto out;
}

/*
* Add it to the front, so that later devices can "override"
* earlier defaults
Expand Down
4 changes: 0 additions & 4 deletions drivers/char/ppdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,10 +782,6 @@ static int __init ppdev_init (void)
err = PTR_ERR(ppdev_class);
goto out_chrdev;
}
for (i = 0; i < PARPORT_MAX; i++) {
devfs_mk_cdev(MKDEV(PP_MAJOR, i),
S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i);
}
if (parport_register_driver(&pp_driver)) {
printk (KERN_WARNING CHRDEV ": unable to register with parport\n");
goto out_class;
Expand Down
8 changes: 0 additions & 8 deletions drivers/char/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ static struct cdev raw_cdev = {

static int __init raw_init(void)
{
int i;
dev_t dev = MKDEV(RAW_MAJOR, 0);

if (register_chrdev_region(dev, MAX_RAW_MINORS, "raw"))
Expand All @@ -310,13 +309,6 @@ static int __init raw_init(void)
}
class_device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl");

devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
S_IFCHR | S_IRUGO | S_IWUGO,
"raw/rawctl");
for (i = 1; i < MAX_RAW_MINORS; i++)
devfs_mk_cdev(MKDEV(RAW_MAJOR, i),
S_IFCHR | S_IRUGO | S_IWUGO,
"raw/raw%d", i);
return 0;

error:
Expand Down
6 changes: 1 addition & 5 deletions drivers/char/stallion.c
Original file line number Diff line number Diff line change
Expand Up @@ -3071,14 +3071,10 @@ static int __init stl_init(void)
printk("STALLION: failed to register serial board device\n");

stallion_class = class_create(THIS_MODULE, "staliomem");
for (i = 0; i < 4; i++) {
devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i),
S_IFCHR|S_IRUSR|S_IWUSR,
"staliomem/%d", i);
for (i = 0; i < 4; i++)
class_device_create(stallion_class, NULL,
MKDEV(STL_SIOMEMMAJOR, i), NULL,
"staliomem%d", i);
}

stl_serial->owner = THIS_MODULE;
stl_serial->driver_name = stl_drvname;
Expand Down
10 changes: 0 additions & 10 deletions drivers/char/tipar.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,6 @@ tipar_register(int nr, struct parport *port)

class_device_create(tipar_class, NULL, MKDEV(TIPAR_MAJOR,
TIPAR_MINOR + nr), NULL, "par%d", nr);
/* Use devfs, tree: /dev/ticables/par/[0..2] */
err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr),
S_IFCHR | S_IRUGO | S_IWUGO,
"ticables/par/%d", nr);
if (err)
goto out_class;

/* Display informations */
pr_info("tipar%d: using %s (%s)\n", nr, port->name, (port->irq ==
Expand All @@ -460,11 +454,7 @@ tipar_register(int nr, struct parport *port)
pr_info("tipar%d: link cable not found\n", nr);

err = 0;
goto out;

out_class:
class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr));
class_destroy(tipar_class);
out:
return err;
}
Expand Down
7 changes: 0 additions & 7 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2979,9 +2979,6 @@ struct class_device *tty_register_device(struct tty_driver *driver,
return ERR_PTR(-EINVAL);
}

devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR,
"%s%d", driver->devfs_name, index + driver->name_base);

if (driver->type == TTY_DRIVER_TYPE_PTY)
pty_line_name(driver, index, name);
else
Expand Down Expand Up @@ -3241,22 +3238,19 @@ static int __init tty_init(void)
if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
panic("Couldn't register /dev/tty driver\n");
devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty");
class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty");

cdev_init(&console_cdev, &console_fops);
if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
panic("Couldn't register /dev/console driver\n");
devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console");
class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, "console");

#ifdef CONFIG_UNIX98_PTYS
cdev_init(&ptmx_cdev, &ptmx_fops);
if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
panic("Couldn't register /dev/ptmx driver\n");
devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx");
class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
#endif

Expand All @@ -3265,7 +3259,6 @@ static int __init tty_init(void)
if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
panic("Couldn't register /dev/tty0 driver\n");
devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0");
class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");

vty_init();
Expand Down
8 changes: 0 additions & 8 deletions drivers/char/vc_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,6 @@ static struct class *vc_class;

void vcs_make_devfs(struct tty_struct *tty)
{
devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 1),
S_IFCHR|S_IRUSR|S_IWUSR,
"vcc/%u", tty->index + 1);
devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129),
S_IFCHR|S_IRUSR|S_IWUSR,
"vcc/a%u", tty->index + 1);
class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1),
NULL, "vcs%u", tty->index + 1);
class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129),
Expand All @@ -503,8 +497,6 @@ int __init vcs_init(void)
panic("unable to get major %d for vcs device", VCS_MAJOR);
vc_class = class_create(THIS_MODULE, "vc");

devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0");
devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0");
class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
return 0;
Expand Down
4 changes: 0 additions & 4 deletions drivers/char/viotape.c
Original file line number Diff line number Diff line change
Expand Up @@ -958,10 +958,6 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
"iseries!vt%d", i);
class_device_create(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i | 0x80),
NULL, "iseries!nvt%d", i);
devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR,
"iseries/vt%d", i);
devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i | 0x80),
S_IFCHR | S_IRUSR | S_IWUSR, "iseries/nvt%d", i);
sprintf(tapename, "iseries/vt%d", i);
printk(VIOTAPE_KERN_INFO "tape %s is iSeries "
"resource %10.10s type %4.4s, model %3.3s\n",
Expand Down
2 changes: 0 additions & 2 deletions drivers/isdn/capi/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,8 +1516,6 @@ static int __init capi_init(void)
}

class_device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi");
devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
"isdn/capi20");

#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) {
Expand Down
1 change: 0 additions & 1 deletion drivers/isdn/hardware/eicon/divamnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ static int DIVA_INIT_FUNCTION divas_maint_register_chrdev(void)
DRIVERLNAME);
return (0);
}
devfs_mk_cdev(MKDEV(major, 0), S_IFCHR|S_IRUSR|S_IWUSR, DEVNAME);

return (1);
}
Expand Down
Loading

0 comments on commit 7c69ef7

Please sign in to comment.