Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / drivers / net / wan / cosa.c
index 7ff814f..6c7dfb5 100644 (file)
 \f
 /* ---------- Headers, macros, data structures ---------- */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/poll.h>
 #include <linux/fs.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -347,7 +345,7 @@ static void put_driver_status(struct cosa_data *cosa);
 static void put_driver_status_nolock(struct cosa_data *cosa);
 
 /* Interrupt handling */
-static irqreturn_t cosa_interrupt(int irq, void *cosa, struct pt_regs *regs);
+static irqreturn_t cosa_interrupt(int irq, void *cosa);
 
 /* I/O ops debugging */
 #ifdef DEBUG_IO
@@ -393,22 +391,14 @@ static int __init cosa_init(void)
                err = -ENODEV;
                goto out;
        }
-       devfs_mk_dir("cosa");
        cosa_class = class_create(THIS_MODULE, "cosa");
        if (IS_ERR(cosa_class)) {
                err = PTR_ERR(cosa_class);
                goto out_chrdev;
        }
        for (i=0; i<nr_cards; i++) {
-               class_device_create(cosa_class, MKDEV(cosa_major, i),
+               class_device_create(cosa_class, NULL, MKDEV(cosa_major, i),
                                NULL, "cosa%d", i);
-               err = devfs_mk_cdev(MKDEV(cosa_major, i),
-                               S_IFCHR|S_IRUSR|S_IWUSR,
-                               "cosa/%d", i);
-               if (err) {
-                       class_device_destroy(cosa_class, MKDEV(cosa_major, i));
-                       goto out_chrdev;                
-               }
        }
        err = 0;
        goto out;
@@ -426,12 +416,9 @@ static void __exit cosa_exit(void)
        int i;
        printk(KERN_INFO "Unloading the cosa module\n");
 
-       for (i=0; i<nr_cards; i++) {
+       for (i=0; i<nr_cards; i++)
                class_device_destroy(cosa_class, MKDEV(cosa_major, i));
-               devfs_remove("cosa/%d", i);
-       }
        class_destroy(cosa_class);
-       devfs_remove("cosa");
        for (cosa=cosa_cards; nr_cards--; cosa++) {
                /* Clean up the per-channel data */
                for (i=0; i<cosa->nchannels; i++) {
@@ -987,12 +974,12 @@ static int cosa_open(struct inode *inode, struct file *file)
        unsigned long flags;
        int n;
 
-       if ((n=iminor(file->f_dentry->d_inode)>>CARD_MINOR_BITS)
+       if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS)
                >= nr_cards)
                return -ENODEV;
        cosa = cosa_cards+n;
 
-       if ((n=iminor(file->f_dentry->d_inode)
+       if ((n=iminor(file->f_path.dentry->d_inode)
                & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels)
                return -ENODEV;
        chan = cosa->chan + n;
@@ -1617,8 +1604,7 @@ static int get_wait_data(struct cosa_data *cosa)
                        return r;
                }
                /* sleep if not ready to read */
-               set_current_state(TASK_INTERRUPTIBLE);
-               schedule_timeout(1);
+               schedule_timeout_interruptible(1);
        }
        printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n",
                cosa_getstatus(cosa));
@@ -1644,8 +1630,7 @@ static int put_wait_data(struct cosa_data *cosa, int data)
                }
 #if 0
                /* sleep if not ready to read */
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(1);
+               schedule_timeout_interruptible(1);
 #endif
        }
        printk(KERN_INFO "cosa%d: timeout in put_wait_data (status 0x%x)\n",
@@ -1987,7 +1972,7 @@ out:
        spin_unlock_irqrestore(&cosa->lock, flags);
 }
 
-static irqreturn_t cosa_interrupt(int irq, void *cosa_, struct pt_regs *regs)
+static irqreturn_t cosa_interrupt(int irq, void *cosa_)
 {
        unsigned status;
        int count = 0;