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