Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Removes the devfs_mk_cdev() function and all callers of it.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+8 -202
-2
arch/sparc64/solaris/socksys.c
··· 190 190 return ret; 191 191 } 192 192 193 - devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUSR|S_IWUSR, "socksys"); 194 - 195 193 file = fcheck(ret); 196 194 /* N.B. Is this valid? Suppose the f_ops are in a module ... */ 197 195 socksys_file_ops = *file->f_op;
-4
drivers/block/acsi_slm.c
··· 1005 1005 BufferP = SLMBuffer; 1006 1006 SLMState = IDLE; 1007 1007 1008 - for (i = 0; i < MAX_SLM; i++) { 1009 - devfs_mk_cdev(MKDEV(ACSI_MAJOR, i), 1010 - S_IFCHR|S_IRUSR|S_IWUSR, "slm/%d", i); 1011 - } 1012 1008 return 0; 1013 1009 } 1014 1010
+1 -10
drivers/block/paride/pg.c
··· 676 676 } 677 677 for (unit = 0; unit < PG_UNITS; unit++) { 678 678 struct pg *dev = &devices[unit]; 679 - if (dev->present) { 679 + if (dev->present) 680 680 class_device_create(pg_class, NULL, MKDEV(major, unit), 681 681 NULL, "pg%u", unit); 682 - err = devfs_mk_cdev(MKDEV(major, unit), 683 - S_IFCHR | S_IRUSR | S_IWUSR, "pg/%u", 684 - unit); 685 - if (err) 686 - goto out_class; 687 - } 688 682 } 689 683 err = 0; 690 684 goto out; 691 685 692 - out_class: 693 - class_device_destroy(pg_class, MKDEV(major, unit)); 694 - class_destroy(pg_class); 695 686 out_chrdev: 696 687 unregister_chrdev(major, "pg"); 697 688 out:
-16
drivers/block/paride/pt.c
··· 975 975 if (pt[unit].present) { 976 976 class_device_create(pt_class, NULL, MKDEV(major, unit), 977 977 NULL, "pt%d", unit); 978 - err = devfs_mk_cdev(MKDEV(major, unit), 979 - S_IFCHR | S_IRUSR | S_IWUSR, 980 - "pt/%d", unit); 981 - if (err) { 982 - class_device_destroy(pt_class, MKDEV(major, unit)); 983 - goto out_class; 984 - } 985 978 class_device_create(pt_class, NULL, MKDEV(major, unit + 128), 986 979 NULL, "pt%dn", unit); 987 - err = devfs_mk_cdev(MKDEV(major, unit + 128), 988 - S_IFCHR | S_IRUSR | S_IWUSR, 989 - "pt/%dn", unit); 990 - if (err) { 991 - class_device_destroy(pt_class, MKDEV(major, unit + 128)); 992 - goto out_class; 993 - } 994 980 } 995 981 goto out; 996 982 997 - out_class: 998 - class_destroy(pt_class); 999 983 out_chrdev: 1000 984 unregister_chrdev(major, "pt"); 1001 985 out:
-8
drivers/char/dsp56k.c
··· 518 518 } 519 519 class_device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k"); 520 520 521 - err = devfs_mk_cdev(MKDEV(DSP56K_MAJOR, 0), 522 - S_IFCHR | S_IRUSR | S_IWUSR, "dsp56k"); 523 - if(err) 524 - goto out_class; 525 - 526 521 printk(banner); 527 522 goto out; 528 523 529 - out_class: 530 - class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0)); 531 - class_destroy(dsp56k_class); 532 524 out_chrdev: 533 525 unregister_chrdev(DSP56K_MAJOR, "dsp56k"); 534 526 out:
-3
drivers/char/dtlk.c
··· 337 337 if (dtlk_dev_probe() == 0) 338 338 printk(", MAJOR %d\n", dtlk_major); 339 339 340 - devfs_mk_cdev(MKDEV(dtlk_major, DTLK_MINOR), 341 - S_IFCHR | S_IRUSR | S_IWUSR, "dtlk"); 342 - 343 340 init_timer(&dtlk_timer); 344 341 dtlk_timer.function = dtlk_timer_tick; 345 342 init_waitqueue_head(&dtlk_process_list);
-18
drivers/char/ftape/zftape/zftape-init.c
··· 332 332 zft_class = class_create(THIS_MODULE, "zft"); 333 333 for (i = 0; i < 4; i++) { 334 334 class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i), NULL, "qft%i", i); 335 - devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i), 336 - S_IFCHR | S_IRUSR | S_IWUSR, 337 - "qft%i", i); 338 335 class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 4), NULL, "nqft%i", i); 339 - devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 4), 340 - S_IFCHR | S_IRUSR | S_IWUSR, 341 - "nqft%i", i); 342 336 class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 16), NULL, "zqft%i", i); 343 - devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 16), 344 - S_IFCHR | S_IRUSR | S_IWUSR, 345 - "zqft%i", i); 346 337 class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 20), NULL, "nzqft%i", i); 347 - devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 20), 348 - S_IFCHR | S_IRUSR | S_IWUSR, 349 - "nzqft%i", i); 350 338 class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 32), NULL, "rawqft%i", i); 351 - devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 32), 352 - S_IFCHR | S_IRUSR | S_IWUSR, 353 - "rawqft%i", i); 354 339 class_device_create(zft_class, NULL, MKDEV(QIC117_TAPE_MAJOR, i + 36), NULL, "nrawrawqft%i", i); 355 - devfs_mk_cdev(MKDEV(QIC117_TAPE_MAJOR, i + 36), 356 - S_IFCHR | S_IRUSR | S_IWUSR, 357 - "nrawqft%i", i); 358 340 } 359 341 360 342 #ifdef CONFIG_ZFT_COMPRESSOR
-17
drivers/char/ip2/ip2main.c
··· 724 724 class_device_create(ip2_class, NULL, 725 725 MKDEV(IP2_IPL_MAJOR, 4 * i), 726 726 NULL, "ipl%d", i); 727 - err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i), 728 - S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, 729 - "ip2/ipl%d", i); 730 - if (err) { 731 - class_device_destroy(ip2_class, 732 - MKDEV(IP2_IPL_MAJOR, 4 * i)); 733 - goto out_class; 734 - } 735 - 736 727 class_device_create(ip2_class, NULL, 737 728 MKDEV(IP2_IPL_MAJOR, 4 * i + 1), 738 729 NULL, "stat%d", i); 739 - err = devfs_mk_cdev(MKDEV(IP2_IPL_MAJOR, 4 * i + 1), 740 - S_IRUSR | S_IWUSR | S_IRGRP | S_IFCHR, 741 - "ip2/stat%d", i); 742 - if (err) { 743 - class_device_destroy(ip2_class, 744 - MKDEV(IP2_IPL_MAJOR, 4 * i + 1)); 745 - goto out_class; 746 - } 747 730 748 731 for ( box = 0; box < ABS_MAX_BOXES; ++box ) 749 732 {
-3
drivers/char/ipmi/ipmi_devintf.c
··· 804 804 dev_t dev = MKDEV(ipmi_major, if_num); 805 805 struct ipmi_reg_list *entry; 806 806 807 - devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, 808 - "ipmidev/%d", if_num); 809 - 810 807 entry = kmalloc(sizeof(*entry), GFP_KERNEL); 811 808 if (!entry) { 812 809 printk(KERN_ERR "ipmi_devintf: Unable to create the"
+1 -5
drivers/char/istallion.c
··· 5214 5214 "device\n"); 5215 5215 5216 5216 istallion_class = class_create(THIS_MODULE, "staliomem"); 5217 - for (i = 0; i < 4; i++) { 5218 - devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), 5219 - S_IFCHR | S_IRUSR | S_IWUSR, 5220 - "staliomem/%d", i); 5217 + for (i = 0; i < 4; i++) 5221 5218 class_device_create(istallion_class, NULL, 5222 5219 MKDEV(STL_SIOMEMMAJOR, i), 5223 5220 NULL, "staliomem%d", i); 5224 - } 5225 5221 5226 5222 /* 5227 5223 * Set up the tty driver structure and register us as a driver.
-2
drivers/char/lp.c
··· 807 807 808 808 class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), NULL, 809 809 "lp%d", nr); 810 - devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO, 811 - "printers/%d", nr); 812 810 813 811 printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name, 814 812 (port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");
+1 -4
drivers/char/mem.c
··· 941 941 printk("unable to get major %d for memory devs\n", MEM_MAJOR); 942 942 943 943 mem_class = class_create(THIS_MODULE, "mem"); 944 - for (i = 0; i < ARRAY_SIZE(devlist); i++) { 944 + for (i = 0; i < ARRAY_SIZE(devlist); i++) 945 945 class_device_create(mem_class, NULL, 946 946 MKDEV(MEM_MAJOR, devlist[i].minor), 947 947 NULL, devlist[i].name); 948 - devfs_mk_cdev(MKDEV(MEM_MAJOR, devlist[i].minor), 949 - S_IFCHR | devlist[i].mode, devlist[i].name); 950 - } 951 948 952 949 return 0; 953 950 }
+1 -8
drivers/char/misc.c
··· 204 204 { 205 205 struct miscdevice *c; 206 206 dev_t dev; 207 - int err; 207 + int err = 0; 208 208 209 209 down(&misc_sem); 210 210 list_for_each_entry(c, &misc_list, list) { ··· 238 238 "%s", misc->name); 239 239 if (IS_ERR(misc->class)) { 240 240 err = PTR_ERR(misc->class); 241 - goto out; 242 - } 243 - 244 - err = devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP, 245 - misc->devfs_name); 246 - if (err) { 247 - class_device_destroy(misc_class, dev); 248 241 goto out; 249 242 } 250 243
-4
drivers/char/ppdev.c
··· 782 782 err = PTR_ERR(ppdev_class); 783 783 goto out_chrdev; 784 784 } 785 - for (i = 0; i < PARPORT_MAX; i++) { 786 - devfs_mk_cdev(MKDEV(PP_MAJOR, i), 787 - S_IFCHR | S_IRUGO | S_IWUGO, "parports/%d", i); 788 - } 789 785 if (parport_register_driver(&pp_driver)) { 790 786 printk (KERN_WARNING CHRDEV ": unable to register with parport\n"); 791 787 goto out_class;
-8
drivers/char/raw.c
··· 288 288 289 289 static int __init raw_init(void) 290 290 { 291 - int i; 292 291 dev_t dev = MKDEV(RAW_MAJOR, 0); 293 292 294 293 if (register_chrdev_region(dev, MAX_RAW_MINORS, "raw")) ··· 309 310 } 310 311 class_device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); 311 312 312 - devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), 313 - S_IFCHR | S_IRUGO | S_IWUGO, 314 - "raw/rawctl"); 315 - for (i = 1; i < MAX_RAW_MINORS; i++) 316 - devfs_mk_cdev(MKDEV(RAW_MAJOR, i), 317 - S_IFCHR | S_IRUGO | S_IWUGO, 318 - "raw/raw%d", i); 319 313 return 0; 320 314 321 315 error:
+1 -5
drivers/char/stallion.c
··· 3071 3071 printk("STALLION: failed to register serial board device\n"); 3072 3072 3073 3073 stallion_class = class_create(THIS_MODULE, "staliomem"); 3074 - for (i = 0; i < 4; i++) { 3075 - devfs_mk_cdev(MKDEV(STL_SIOMEMMAJOR, i), 3076 - S_IFCHR|S_IRUSR|S_IWUSR, 3077 - "staliomem/%d", i); 3074 + for (i = 0; i < 4; i++) 3078 3075 class_device_create(stallion_class, NULL, 3079 3076 MKDEV(STL_SIOMEMMAJOR, i), NULL, 3080 3077 "staliomem%d", i); 3081 - } 3082 3078 3083 3079 stl_serial->owner = THIS_MODULE; 3084 3080 stl_serial->driver_name = stl_drvname;
-10
drivers/char/tipar.c
··· 443 443 444 444 class_device_create(tipar_class, NULL, MKDEV(TIPAR_MAJOR, 445 445 TIPAR_MINOR + nr), NULL, "par%d", nr); 446 - /* Use devfs, tree: /dev/ticables/par/[0..2] */ 447 - err = devfs_mk_cdev(MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr), 448 - S_IFCHR | S_IRUGO | S_IWUGO, 449 - "ticables/par/%d", nr); 450 - if (err) 451 - goto out_class; 452 446 453 447 /* Display informations */ 454 448 pr_info("tipar%d: using %s (%s)\n", nr, port->name, (port->irq == ··· 454 460 pr_info("tipar%d: link cable not found\n", nr); 455 461 456 462 err = 0; 457 - goto out; 458 463 459 - out_class: 460 - class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, TIPAR_MINOR + nr)); 461 - class_destroy(tipar_class); 462 464 out: 463 465 return err; 464 466 }
-7
drivers/char/tty_io.c
··· 2979 2979 return ERR_PTR(-EINVAL); 2980 2980 } 2981 2981 2982 - devfs_mk_cdev(dev, S_IFCHR | S_IRUSR | S_IWUSR, 2983 - "%s%d", driver->devfs_name, index + driver->name_base); 2984 - 2985 2982 if (driver->type == TTY_DRIVER_TYPE_PTY) 2986 2983 pty_line_name(driver, index, name); 2987 2984 else ··· 3238 3241 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || 3239 3242 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) 3240 3243 panic("Couldn't register /dev/tty driver\n"); 3241 - devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 0), S_IFCHR|S_IRUGO|S_IWUGO, "tty"); 3242 3244 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL, "tty"); 3243 3245 3244 3246 cdev_init(&console_cdev, &console_fops); 3245 3247 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || 3246 3248 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) 3247 3249 panic("Couldn't register /dev/console driver\n"); 3248 - devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 1), S_IFCHR|S_IRUSR|S_IWUSR, "console"); 3249 3250 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL, "console"); 3250 3251 3251 3252 #ifdef CONFIG_UNIX98_PTYS ··· 3251 3256 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || 3252 3257 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) 3253 3258 panic("Couldn't register /dev/ptmx driver\n"); 3254 - devfs_mk_cdev(MKDEV(TTYAUX_MAJOR, 2), S_IFCHR|S_IRUGO|S_IWUGO, "ptmx"); 3255 3259 class_device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx"); 3256 3260 #endif 3257 3261 ··· 3259 3265 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) || 3260 3266 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) 3261 3267 panic("Couldn't register /dev/tty0 driver\n"); 3262 - devfs_mk_cdev(MKDEV(TTY_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vc/0"); 3263 3268 class_device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0"); 3264 3269 3265 3270 vty_init();
-8
drivers/char/vc_screen.c
··· 478 478 479 479 void vcs_make_devfs(struct tty_struct *tty) 480 480 { 481 - devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 1), 482 - S_IFCHR|S_IRUSR|S_IWUSR, 483 - "vcc/%u", tty->index + 1); 484 - devfs_mk_cdev(MKDEV(VCS_MAJOR, tty->index + 129), 485 - S_IFCHR|S_IRUSR|S_IWUSR, 486 - "vcc/a%u", tty->index + 1); 487 481 class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1), 488 482 NULL, "vcs%u", tty->index + 1); 489 483 class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129), ··· 497 503 panic("unable to get major %d for vcs device", VCS_MAJOR); 498 504 vc_class = class_create(THIS_MODULE, "vc"); 499 505 500 - devfs_mk_cdev(MKDEV(VCS_MAJOR, 0), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/0"); 501 - devfs_mk_cdev(MKDEV(VCS_MAJOR, 128), S_IFCHR|S_IRUSR|S_IWUSR, "vcc/a0"); 502 506 class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); 503 507 class_device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); 504 508 return 0;
-4
drivers/char/viotape.c
··· 958 958 "iseries!vt%d", i); 959 959 class_device_create(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i | 0x80), 960 960 NULL, "iseries!nvt%d", i); 961 - devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i), S_IFCHR | S_IRUSR | S_IWUSR, 962 - "iseries/vt%d", i); 963 - devfs_mk_cdev(MKDEV(VIOTAPE_MAJOR, i | 0x80), 964 - S_IFCHR | S_IRUSR | S_IWUSR, "iseries/nvt%d", i); 965 961 sprintf(tapename, "iseries/vt%d", i); 966 962 printk(VIOTAPE_KERN_INFO "tape %s is iSeries " 967 963 "resource %10.10s type %4.4s, model %3.3s\n",
-2
drivers/isdn/capi/capi.c
··· 1516 1516 } 1517 1517 1518 1518 class_device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi"); 1519 - devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR, 1520 - "isdn/capi20"); 1521 1519 1522 1520 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 1523 1521 if (capinc_tty_init() < 0) {
-1
drivers/isdn/hardware/eicon/divamnt.c
··· 190 190 DRIVERLNAME); 191 191 return (0); 192 192 } 193 - devfs_mk_cdev(MKDEV(major, 0), S_IFCHR|S_IRUSR|S_IWUSR, DEVNAME); 194 193 195 194 return (1); 196 195 }
-1
drivers/isdn/hardware/eicon/divasi.c
··· 157 157 DRIVERLNAME); 158 158 return (0); 159 159 } 160 - devfs_mk_cdev(MKDEV(major, 0), S_IFCHR|S_IRUSR|S_IWUSR, DEVNAME); 161 160 162 161 return (1); 163 162 }
-1
drivers/isdn/hardware/eicon/divasmain.c
··· 690 690 DRIVERLNAME); 691 691 return (0); 692 692 } 693 - devfs_mk_cdev(MKDEV(major, 0), S_IFCHR|S_IRUSR|S_IWUSR, DEVNAME); 694 693 695 694 return (1); 696 695 }
-2
drivers/macintosh/adb.c
··· 904 904 return; 905 905 } 906 906 907 - devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb"); 908 - 909 907 adb_dev_class = class_create(THIS_MODULE, "adb"); 910 908 if (IS_ERR(adb_dev_class)) 911 909 return;
-4
drivers/media/dvb/dvb-core/dvbdev.c
··· 231 231 232 232 mutex_unlock(&dvbdev_register_lock); 233 233 234 - devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 235 - S_IFCHR | S_IRUSR | S_IWUSR, 236 - "dvb/adapter%d/%s%d", adap->num, dnames[type], id); 237 - 238 234 class_device_create(dvb_class, NULL, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 239 235 adap->device, "dvb%d.%s%d", adap->num, dnames[type], id); 240 236
+2 -5
drivers/media/video/videodev.c
··· 1563 1563 video_device[i]=vfd; 1564 1564 vfd->minor=i; 1565 1565 mutex_unlock(&videodev_lock); 1566 - 1567 - sprintf(vfd->devfs_name, "v4l/%s%d", name_base, i - base); 1568 - devfs_mk_cdev(MKDEV(VIDEO_MAJOR, vfd->minor), 1569 - S_IFCHR | S_IRUSR | S_IWUSR, vfd->devfs_name); 1570 1566 mutex_init(&vfd->lock); 1571 1567 1572 1568 /* sysfs class */ ··· 1571 1575 vfd->class_dev.dev = vfd->dev; 1572 1576 vfd->class_dev.class = &video_class; 1573 1577 vfd->class_dev.devt = MKDEV(VIDEO_MAJOR, vfd->minor); 1574 - strlcpy(vfd->class_dev.class_id, vfd->devfs_name + 4, BUS_ID_SIZE); 1578 + sprintf(vfd->devfs_name, "%s%d", name_base, i - base); 1579 + strlcpy(vfd->class_dev.class_id, vfd->devfs_name, BUS_ID_SIZE); 1575 1580 class_device_register(&vfd->class_dev); 1576 1581 class_device_create_file(&vfd->class_dev, 1577 1582 &class_device_attr_name);
-7
drivers/net/ppp_generic.c
··· 863 863 goto out_chrdev; 864 864 } 865 865 class_device_create(ppp_class, NULL, MKDEV(PPP_MAJOR, 0), NULL, "ppp"); 866 - err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0), 867 - S_IFCHR|S_IRUSR|S_IWUSR, "ppp"); 868 - if (err) 869 - goto out_class; 870 866 } 871 867 872 868 out: ··· 870 874 printk(KERN_ERR "failed to register PPP device (%d)\n", err); 871 875 return err; 872 876 873 - out_class: 874 - class_device_destroy(ppp_class, MKDEV(PPP_MAJOR,0)); 875 - class_destroy(ppp_class); 876 877 out_chrdev: 877 878 unregister_chrdev(PPP_MAJOR, "ppp"); 878 879 goto out;
-7
drivers/net/wan/cosa.c
··· 401 401 for (i=0; i<nr_cards; i++) { 402 402 class_device_create(cosa_class, NULL, MKDEV(cosa_major, i), 403 403 NULL, "cosa%d", i); 404 - err = devfs_mk_cdev(MKDEV(cosa_major, i), 405 - S_IFCHR|S_IRUSR|S_IWUSR, 406 - "cosa/%d", i); 407 - if (err) { 408 - class_device_destroy(cosa_class, MKDEV(cosa_major, i)); 409 - goto out_chrdev; 410 - } 411 404 } 412 405 err = 0; 413 406 goto out;
-4
drivers/sbus/char/bpp.c
··· 1031 1031 instances[idx].opened = 0; 1032 1032 probeLptPort(idx); 1033 1033 } 1034 - for (idx = 0; idx < BPP_NO; idx++) { 1035 - devfs_mk_cdev(MKDEV(BPP_MAJOR, idx), 1036 - S_IFCHR | S_IRUSR | S_IWUSR, "bpp/%d", idx); 1037 - } 1038 1034 1039 1035 return 0; 1040 1036 }
-4
drivers/sbus/char/vfc_dev.c
··· 164 164 return -EINVAL; 165 165 if (init_vfc_hw(dev)) 166 166 return -EIO; 167 - 168 - devfs_mk_cdev(MKDEV(VFC_MAJOR, instance), 169 - S_IFCHR | S_IRUSR | S_IWUSR, 170 - "vfc/%d", instance); 171 167 return 0; 172 168 } 173 169
-2
drivers/telephony/phonedev.c
··· 106 106 if (phone_device[i] == NULL) { 107 107 phone_device[i] = p; 108 108 p->minor = i; 109 - devfs_mk_cdev(MKDEV(PHONE_MAJOR,i), 110 - S_IFCHR|S_IRUSR|S_IWUSR, "phone/%d", i); 111 109 mutex_unlock(&phone_lock); 112 110 return 0; 113 111 }
-2
drivers/video/fbmem.c
··· 1331 1331 fb_add_videomode(&mode, &fb_info->modelist); 1332 1332 registered_fb[i] = fb_info; 1333 1333 1334 - devfs_mk_cdev(MKDEV(FB_MAJOR, i), 1335 - S_IFCHR | S_IRUGO | S_IWUGO, "fb/%d", i); 1336 1334 event.info = fb_info; 1337 1335 blocking_notifier_call_chain(&fb_notifier_list, 1338 1336 FB_EVENT_FB_REGISTERED, &event);
+1 -10
fs/coda/psdev.c
··· 365 365 err = PTR_ERR(coda_psdev_class); 366 366 goto out_chrdev; 367 367 } 368 - for (i = 0; i < MAX_CODADEVS; i++) { 368 + for (i = 0; i < MAX_CODADEVS; i++) 369 369 class_device_create(coda_psdev_class, NULL, 370 370 MKDEV(CODA_PSDEV_MAJOR,i), NULL, "cfs%d", i); 371 - err = devfs_mk_cdev(MKDEV(CODA_PSDEV_MAJOR, i), 372 - S_IFCHR|S_IRUSR|S_IWUSR, "coda/%d", i); 373 - if (err) 374 - goto out_class; 375 - } 376 371 coda_sysctl_init(); 377 372 goto out; 378 373 379 - out_class: 380 - for (i = 0; i < MAX_CODADEVS; i++) 381 - class_device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); 382 - class_destroy(coda_psdev_class); 383 374 out_chrdev: 384 375 unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); 385 376 out:
-4
include/linux/devfs_fs_kernel.h
··· 6 6 #include <linux/types.h> 7 7 #include <asm/semaphore.h> 8 8 9 - static inline int devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...) 10 - { 11 - return 0; 12 - } 13 9 static inline void devfs_remove(const char *fmt, ...) 14 10 { 15 11 }