Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / char / ppdev.c
index 3aab837..7af7a7e 100644 (file)
@@ -66,6 +66,7 @@
 #include <linux/poll.h>
 #include <linux/major.h>
 #include <linux/ppdev.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 
 #define PP_VERSION "ppdev: user-space parallel port driver"
@@ -638,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;
 
@@ -750,8 +752,9 @@ static const struct file_operations pp_fops = {
 
 static void pp_attach(struct parport *port)
 {
-       device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number),
-                       "parport%d", port->number);
+       device_create_drvdata(ppdev_class, port->dev,
+                             MKDEV(PP_MAJOR, port->number),
+                             NULL, "parport%d", port->number);
 }
 
 static void pp_detach(struct parport *port)