ieee1394: remove devfs support

Devfs has been disabled in the last kernel releases, so let's
remove it from ieee1394core, raw1394, video1394, dv1394.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Dan Dennedy <dan@dennedy.org>
Signed-off-by: Jody McIntyre <scjody@modernduck.com>

authored by

Stefan Richter and committed by
Jody McIntyre
a8748445 e2f8165d

+5 -73
+2 -39
drivers/ieee1394/dv1394.c
··· 73 73 - fix all XXX showstoppers 74 74 - disable IR/IT DMA interrupts on shutdown 75 75 - flush pci writes to the card by issuing a read 76 - - devfs and character device dispatching (* needs testing with Linux 2.2.x) 76 + - character device dispatching 77 77 - switch over to the new kernel DMA API (pci_map_*()) (* needs testing on platforms with IOMMU!) 78 78 - keep all video_cards in a list (for open() via chardev), set file->private_data = video 79 79 - dv1394_poll should indicate POLLIN when receiving buffers are available ··· 1096 1096 1097 1097 init.api_version = DV1394_API_VERSION; 1098 1098 init.n_frames = DV1394_MAX_FRAMES / 4; 1099 - /* the following are now set via devfs */ 1100 1099 init.channel = video->channel; 1101 1100 init.format = video->pal_or_ntsc; 1102 1101 init.cip_n = video->cip_n; ··· 1790 1791 { 1791 1792 struct video_card *video = NULL; 1792 1793 1793 - /* if the device was opened through devfs, then file->private_data 1794 - has already been set to video by devfs */ 1795 1794 if (file->private_data) { 1796 1795 video = (struct video_card*) file->private_data; 1797 1796 ··· 2208 2211 video = kzalloc(sizeof(*video), GFP_KERNEL); 2209 2212 if (!video) { 2210 2213 printk(KERN_ERR "dv1394: cannot allocate video_card\n"); 2211 - goto err; 2214 + return -1; 2212 2215 } 2213 2216 2214 2217 video->ohci = ohci; ··· 2263 2266 list_add_tail(&video->list, &dv1394_cards); 2264 2267 spin_unlock_irqrestore(&dv1394_cards_lock, flags); 2265 2268 2266 - if (devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, 2267 - IEEE1394_MINOR_BLOCK_DV1394*16 + video->id), 2268 - S_IFCHR|S_IRUGO|S_IWUGO, 2269 - "ieee1394/dv/host%d/%s/%s", 2270 - (video->id>>2), 2271 - (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"), 2272 - (video->mode == MODE_RECEIVE ? "in" : "out")) < 0) 2273 - goto err_free; 2274 - 2275 2269 debug_printk("dv1394: dv1394_init() OK on ID %d\n", video->id); 2276 - 2277 2270 return 0; 2278 - 2279 - err_free: 2280 - kfree(video); 2281 - err: 2282 - return -1; 2283 2271 } 2284 2272 2285 2273 static void dv1394_un_init(struct video_card *video) 2286 2274 { 2287 - char buf[32]; 2288 - 2289 2275 /* obviously nobody has the driver open at this point */ 2290 2276 do_dv1394_shutdown(video, 1); 2291 - snprintf(buf, sizeof(buf), "dv/host%d/%s/%s", (video->id >> 2), 2292 - (video->pal_or_ntsc == DV1394_NTSC ? "NTSC" : "PAL"), 2293 - (video->mode == MODE_RECEIVE ? "in" : "out") 2294 - ); 2295 - 2296 - devfs_remove("ieee1394/%s", buf); 2297 2277 kfree(video); 2298 2278 } 2299 2279 ··· 2307 2333 2308 2334 class_device_destroy(hpsb_protocol_class, 2309 2335 MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2))); 2310 - devfs_remove("ieee1394/dv/host%d/NTSC", id); 2311 - devfs_remove("ieee1394/dv/host%d/PAL", id); 2312 - devfs_remove("ieee1394/dv/host%d", id); 2313 2336 } 2314 2337 2315 2338 static void dv1394_add_host (struct hpsb_host *host) ··· 2323 2352 class_device_create(hpsb_protocol_class, NULL, MKDEV( 2324 2353 IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_DV1394 * 16 + (id<<2)), 2325 2354 NULL, "dv1394-%d", id); 2326 - devfs_mk_dir("ieee1394/dv/host%d", id); 2327 - devfs_mk_dir("ieee1394/dv/host%d/NTSC", id); 2328 - devfs_mk_dir("ieee1394/dv/host%d/PAL", id); 2329 2355 2330 2356 dv1394_init(ohci, DV1394_NTSC, MODE_RECEIVE); 2331 2357 dv1394_init(ohci, DV1394_NTSC, MODE_TRANSMIT); ··· 2579 2611 static void __exit dv1394_exit_module(void) 2580 2612 { 2581 2613 hpsb_unregister_protocol(&dv1394_driver); 2582 - 2583 2614 hpsb_unregister_highlevel(&dv1394_highlevel); 2584 2615 cdev_del(&dv1394_cdev); 2585 - devfs_remove("ieee1394/dv"); 2586 2616 } 2587 2617 2588 2618 static int __init dv1394_init_module(void) ··· 2596 2630 return ret; 2597 2631 } 2598 2632 2599 - devfs_mk_dir("ieee1394/dv"); 2600 - 2601 2633 hpsb_register_highlevel(&dv1394_highlevel); 2602 2634 2603 2635 ret = hpsb_register_protocol(&dv1394_driver); 2604 2636 if (ret) { 2605 2637 printk(KERN_ERR "dv1394: failed to register protocol\n"); 2606 2638 hpsb_unregister_highlevel(&dv1394_highlevel); 2607 - devfs_remove("ieee1394/dv"); 2608 2639 cdev_del(&dv1394_cdev); 2609 2640 return ret; 2610 2641 }
+2 -12
drivers/ieee1394/ieee1394_core.c
··· 1078 1078 goto exit_release_kernel_thread; 1079 1079 } 1080 1080 1081 - /* actually this is a non-fatal error */ 1082 - ret = devfs_mk_dir("ieee1394"); 1083 - if (ret < 0) { 1084 - HPSB_ERR("unable to make devfs dir for device major %d!\n", IEEE1394_MAJOR); 1085 - goto release_chrdev; 1086 - } 1087 - 1088 1081 ret = bus_register(&ieee1394_bus_type); 1089 1082 if (ret < 0) { 1090 1083 HPSB_INFO("bus register failed"); 1091 - goto release_devfs; 1084 + goto release_chrdev; 1092 1085 } 1093 1086 1094 1087 for (i = 0; fw_bus_attrs[i]; i++) { ··· 1092 1099 fw_bus_attrs[i--]); 1093 1100 } 1094 1101 bus_unregister(&ieee1394_bus_type); 1095 - goto release_devfs; 1102 + goto release_chrdev; 1096 1103 } 1097 1104 } 1098 1105 ··· 1145 1152 for (i = 0; fw_bus_attrs[i]; i++) 1146 1153 bus_remove_file(&ieee1394_bus_type, fw_bus_attrs[i]); 1147 1154 bus_unregister(&ieee1394_bus_type); 1148 - release_devfs: 1149 - devfs_remove("ieee1394"); 1150 1155 release_chrdev: 1151 1156 unregister_chrdev_region(IEEE1394_CORE_DEV, 256); 1152 1157 exit_release_kernel_thread: ··· 1182 1191 hpsb_cleanup_config_roms(); 1183 1192 1184 1193 unregister_chrdev_region(IEEE1394_CORE_DEV, 256); 1185 - devfs_remove("ieee1394"); 1186 1194 } 1187 1195 1188 1196 module_init(ieee1394_init);
-1
drivers/ieee1394/ieee1394_core.h
··· 3 3 #define _IEEE1394_CORE_H 4 4 5 5 #include <linux/slab.h> 6 - #include <linux/devfs_fs_kernel.h> 7 6 #include <asm/atomic.h> 8 7 #include <asm/semaphore.h> 9 8 #include "hosts.h"
-6
drivers/ieee1394/raw1394.c
··· 41 41 #include <linux/cdev.h> 42 42 #include <asm/uaccess.h> 43 43 #include <asm/atomic.h> 44 - #include <linux/devfs_fs_kernel.h> 45 44 #include <linux/compat.h> 46 45 47 46 #include "csr1212.h" ··· 2998 2999 goto out_unreg; 2999 3000 } 3000 3001 3001 - devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, IEEE1394_MINOR_BLOCK_RAW1394 * 16), 3002 - S_IFCHR | S_IRUSR | S_IWUSR, RAW1394_DEVICE_NAME); 3003 - 3004 3002 cdev_init(&raw1394_cdev, &raw1394_fops); 3005 3003 raw1394_cdev.owner = THIS_MODULE; 3006 3004 kobject_set_name(&raw1394_cdev.kobj, RAW1394_DEVICE_NAME); ··· 3019 3023 goto out; 3020 3024 3021 3025 out_dev: 3022 - devfs_remove(RAW1394_DEVICE_NAME); 3023 3026 class_device_destroy(hpsb_protocol_class, 3024 3027 MKDEV(IEEE1394_MAJOR, 3025 3028 IEEE1394_MINOR_BLOCK_RAW1394 * 16)); ··· 3034 3039 MKDEV(IEEE1394_MAJOR, 3035 3040 IEEE1394_MINOR_BLOCK_RAW1394 * 16)); 3036 3041 cdev_del(&raw1394_cdev); 3037 - devfs_remove(RAW1394_DEVICE_NAME); 3038 3042 hpsb_unregister_highlevel(&raw1394_highlevel); 3039 3043 hpsb_unregister_protocol(&raw1394_driver); 3040 3044 }
+1 -15
drivers/ieee1394/video1394.c
··· 42 42 #include <linux/poll.h> 43 43 #include <linux/smp_lock.h> 44 44 #include <linux/delay.h> 45 - #include <linux/devfs_fs_kernel.h> 46 45 #include <linux/bitops.h> 47 46 #include <linux/types.h> 48 47 #include <linux/vmalloc.h> ··· 1321 1322 class_device_create(hpsb_protocol_class, NULL, MKDEV( 1322 1323 IEEE1394_MAJOR, minor), 1323 1324 NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1324 - devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor), 1325 - S_IFCHR | S_IRUSR | S_IWUSR, 1326 - "%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1327 1325 } 1328 1326 1329 1327 ··· 1328 1332 { 1329 1333 struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host); 1330 1334 1331 - if (ohci) { 1335 + if (ohci) 1332 1336 class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR, 1333 1337 IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id)); 1334 - devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id); 1335 - } 1336 - 1337 1338 return; 1338 1339 } 1339 1340 ··· 1471 1478 static void __exit video1394_exit_module (void) 1472 1479 { 1473 1480 hpsb_unregister_protocol(&video1394_driver); 1474 - 1475 1481 hpsb_unregister_highlevel(&video1394_highlevel); 1476 - 1477 - devfs_remove(VIDEO1394_DRIVER_NAME); 1478 1482 cdev_del(&video1394_cdev); 1479 - 1480 1483 PRINT_G(KERN_INFO, "Removed " VIDEO1394_DRIVER_NAME " module"); 1481 1484 } 1482 1485 ··· 1489 1500 return ret; 1490 1501 } 1491 1502 1492 - devfs_mk_dir(VIDEO1394_DRIVER_NAME); 1493 - 1494 1503 hpsb_register_highlevel(&video1394_highlevel); 1495 1504 1496 1505 ret = hpsb_register_protocol(&video1394_driver); 1497 1506 if (ret) { 1498 1507 PRINT_G(KERN_ERR, "video1394: failed to register protocol"); 1499 1508 hpsb_unregister_highlevel(&video1394_highlevel); 1500 - devfs_remove(VIDEO1394_DRIVER_NAME); 1501 1509 cdev_del(&video1394_cdev); 1502 1510 return ret; 1503 1511 }