]> err.no Git - linux-2.6/blobdiff - drivers/ieee1394/video1394.c
Pull bugzilla-5000 into release branch
[linux-2.6] / drivers / ieee1394 / video1394.c
index 07050f0e409884ef9d9e39bcb6fbcb61a486a89a..4e3bd62c458df809c35d637442e3ac7c89eeddf6 100644 (file)
  *
  * NOTES:
  *
- * jds -- add private data to file to keep track of iso contexts associated
- * with each open -- so release won't kill all iso transfers.
- * 
- * Damien Douxchamps: Fix failure when the number of DMA pages per frame is
- * one.
- * 
  * ioctl return codes:
  * EFAULT is only for invalid address for the argp
  * EINVAL for out of range values
  * ENOTTY for unsupported ioctl request
  *
  */
-
-/* Markus Tavenrath <speedygoo@speedygoo.de> :
-   - fixed checks for valid buffer-numbers in video1394_icotl
-   - changed the ways the dma prg's are used, now it's possible to use
-     even a single dma buffer
-*/
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <linux/poll.h>
 #include <linux/smp_lock.h>
 #include <linux/delay.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/bitops.h>
 #include <linux/types.h>
 #include <linux/vmalloc.h>
 #include <linux/timex.h>
 #include <linux/mm.h>
-#include <linux/ioctl32.h>
 #include <linux/compat.h>
 #include <linux/cdev.h>
 
@@ -503,7 +489,7 @@ static void wakeup_dma_ir_ctx(unsigned long l)
                if (d->ir_prg[i][d->nb_cmd-1].status & cpu_to_le32(0xFFFF0000)) {
                        reset_ir_status(d, i);
                        d->buffer_status[d->buffer_prg_assignment[i]] = VIDEO1394_BUFFER_READY;
-                       do_gettimeofday(&d->buffer_time[i]);
+                       do_gettimeofday(&d->buffer_time[d->buffer_prg_assignment[i]]);
                }
        }
 
@@ -757,7 +743,7 @@ static int __video1394_ioctl(struct file *file,
                        if (i == ISO_CHANNELS) {
                            PRINT(KERN_ERR, ohci->host->id, 
                                  "No free channel found");
-                           return EAGAIN;
+                           return -EAGAIN;
                        }
                        if (!(ohci->ISO_channel_usage & mask)) {
                            v.channel = i;
@@ -1010,7 +996,6 @@ static int __video1394_ioctl(struct file *file,
 
                /* set time of buffer */
                v.filltime = d->buffer_time[v.buffer];
-//             printk("Buffer %d time %d\n", v.buffer, (d->buffer_time[v.buffer]).tv_usec);
 
                /*
                 * Look ahead to see how many more buffers have been received
@@ -1068,7 +1053,7 @@ static int __video1394_ioctl(struct file *file,
 
                spin_lock_irqsave(&d->lock,flags);
 
-               // last_buffer is last_prg
+               /* last_buffer is last_prg */
                next_prg = (d->last_buffer + 1) % d->num_desc;
                if (d->buffer_status[v.buffer]!=VIDEO1394_BUFFER_FREE) {
                        PRINT(KERN_ERR, ohci->host->id,
@@ -1336,9 +1321,6 @@ static void video1394_add_host (struct hpsb_host *host)
        class_device_create(hpsb_protocol_class, NULL, MKDEV(
                IEEE1394_MAJOR, minor), 
                NULL, "%s-%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
-       devfs_mk_cdev(MKDEV(IEEE1394_MAJOR, minor),
-                      S_IFCHR | S_IRUSR | S_IWUSR,
-                      "%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
 }
 
 
@@ -1346,12 +1328,9 @@ static void video1394_remove_host (struct hpsb_host *host)
 {
        struct ti_ohci *ohci = hpsb_get_hostinfo(&video1394_highlevel, host);
 
-       if (ohci) {
+       if (ohci)
                class_device_destroy(hpsb_protocol_class, MKDEV(IEEE1394_MAJOR,
                        IEEE1394_MINOR_BLOCK_VIDEO1394 * 16 + ohci->host->id));
-               devfs_remove("%s/%d", VIDEO1394_DRIVER_NAME, ohci->host->id);
-       }
-       
        return;
 }
 
@@ -1492,12 +1471,8 @@ static long video1394_compat_ioctl(struct file *f, unsigned cmd, unsigned long a
 static void __exit video1394_exit_module (void)
 {
        hpsb_unregister_protocol(&video1394_driver);
-
        hpsb_unregister_highlevel(&video1394_highlevel);
-
-       devfs_remove(VIDEO1394_DRIVER_NAME);
        cdev_del(&video1394_cdev);
-
        PRINT_G(KERN_INFO, "Removed " VIDEO1394_DRIVER_NAME " module");
 }
 
@@ -1514,15 +1489,12 @@ static int __init video1394_init_module (void)
                return ret;
         }
 
-       devfs_mk_dir(VIDEO1394_DRIVER_NAME);
-
        hpsb_register_highlevel(&video1394_highlevel);
 
        ret = hpsb_register_protocol(&video1394_driver);
        if (ret) {
                PRINT_G(KERN_ERR, "video1394: failed to register protocol");
                hpsb_unregister_highlevel(&video1394_highlevel);
-               devfs_remove(VIDEO1394_DRIVER_NAME);
                cdev_del(&video1394_cdev);
                return ret;
        }