Merge branch 'linus' into x86/urgent
[pandora-kernel.git] / drivers / char / ppdev.c
index 4abd1ef..f6e6aca 100644 (file)
@@ -67,7 +67,6 @@
 #include <linux/major.h>
 #include <linux/ppdev.h>
 #include <linux/smp_lock.h>
-#include <linux/device.h>
 #include <asm/uaccess.h>
 
 #define PP_VERSION "ppdev: user-space parallel port driver"
@@ -269,9 +268,9 @@ static ssize_t pp_write (struct file * file, const char __user * buf,
        return bytes_written;
 }
 
-static void pp_irq (int irq, void * private)
+static void pp_irq (void *private)
 {
-       struct pp_struct * pp = (struct pp_struct *) private;
+       struct pp_struct *pp = private;
 
        if (pp->irqresponse) {
                parport_write_control (pp->pdev->port, pp->irqctl);
@@ -640,6 +639,7 @@ static int pp_open (struct inode * inode, struct file * file)
        unsigned int minor = iminor(inode);
        struct pp_struct *pp;
 
+       cycle_kernel_lock();
        if (minor >= PARPORT_MAX)
                return -ENXIO;
 
@@ -752,7 +752,7 @@ static const struct file_operations pp_fops = {
 
 static void pp_attach(struct parport *port)
 {
-       device_create(ppdev_class, NULL, MKDEV(PP_MAJOR, port->number),
+       device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number),
                        "parport%d", port->number);
 }