]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/ppdev.c
frv: unbreak misalignment handling changes
[linux-2.6-omap-h63xx.git] / drivers / char / ppdev.c
index c8a2eb1a558fba42675fce37645866439ba5c0b8..3aab837d9480ae57e66fb9f438e76efd263fea95 100644 (file)
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/device.h>
-#include <linux/devfs_fs_kernel.h>
 #include <linux/ioctl.h>
 #include <linux/parport.h>
 #include <linux/ctype.h>
 #include <linux/poll.h>
 #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"
@@ -107,7 +104,7 @@ static inline void pp_enable_irq (struct pp_struct *pp)
 static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
                        loff_t * ppos)
 {
-       unsigned int minor = iminor(file->f_dentry->d_inode);
+       unsigned int minor = iminor(file->f_path.dentry->d_inode);
        struct pp_struct *pp = file->private_data;
        char * kbuffer;
        ssize_t bytes_read = 0;
@@ -190,7 +187,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
 static ssize_t pp_write (struct file * file, const char __user * buf,
                         size_t count, loff_t * ppos)
 {
-       unsigned int minor = iminor(file->f_dentry->d_inode);
+       unsigned int minor = iminor(file->f_path.dentry->d_inode);
        struct pp_struct *pp = file->private_data;
        char * kbuffer;
        ssize_t bytes_written = 0;
@@ -270,9 +267,9 @@ static ssize_t pp_write (struct file * file, const char __user * buf,
        return bytes_written;
 }
 
-static void pp_irq (int irq, void * private, struct pt_regs * unused)
+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);
@@ -740,7 +737,7 @@ static unsigned int pp_poll (struct file * file, poll_table * wait)
 
 static struct class *ppdev_class;
 
-static struct file_operations pp_fops = {
+static const struct file_operations pp_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = pp_read,
@@ -753,13 +750,13 @@ static struct file_operations pp_fops = {
 
 static void pp_attach(struct parport *port)
 {
-       class_device_create(ppdev_class, NULL, MKDEV(PP_MAJOR, port->number),
-                       NULL, "parport%d", port->number);
+       device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number),
+                       "parport%d", port->number);
 }
 
 static void pp_detach(struct parport *port)
 {
-       class_device_destroy(ppdev_class, MKDEV(PP_MAJOR, port->number));
+       device_destroy(ppdev_class, MKDEV(PP_MAJOR, port->number));
 }
 
 static struct parport_driver pp_driver = {