]> err.no Git - linux-2.6/blobdiff - drivers/char/ppdev.c
V4L/DVB (8469): cx23885: FusionHDTV7 Dual Express toggle reset.
[linux-2.6] / drivers / char / ppdev.c
index 3aab837d9480ae57e66fb9f438e76efd263fea95..7af7a7e6b9c2e570ff53eff4152e5f61d6cf7738 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)