[Bluetooth] Add open and close callbacks for HID device
[pandora-kernel.git] / sound / oss / soundcard.c
index 75c5e74..dcd8d6d 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/ctype.h>
 #include <linux/stddef.h>
 #include <linux/kmod.h>
+#include <linux/kernel.h>
 #include <asm/dma.h>
 #include <asm/io.h>
 #include <linux/wait.h>
@@ -42,6 +43,7 @@
 #include <linux/proc_fs.h>
 #include <linux/smp_lock.h>
 #include <linux/module.h>
+#include <linux/mm.h>
 
 /*
  * This ought to be moved into include/asm/dma.h
@@ -140,7 +142,7 @@ static int get_mixer_levels(void __user * arg)
 
 static ssize_t sound_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
 {
-       int dev = iminor(file->f_dentry->d_inode);
+       int dev = iminor(file->f_path.dentry->d_inode);
        int ret = -EINVAL;
 
        /*
@@ -173,7 +175,7 @@ static ssize_t sound_read(struct file *file, char __user *buf, size_t count, lof
 
 static ssize_t sound_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
 {
-       int dev = iminor(file->f_dentry->d_inode);
+       int dev = iminor(file->f_path.dentry->d_inode);
        int ret = -EINVAL;
        
        lock_kernel();
@@ -392,7 +394,7 @@ static int sound_ioctl(struct inode *inode, struct file *file,
 
 static unsigned int sound_poll(struct file *file, poll_table * wait)
 {
-       struct inode *inode = file->f_dentry->d_inode;
+       struct inode *inode = file->f_path.dentry->d_inode;
        int dev = iminor(inode);
 
        DEB(printk("sound_poll(dev=%d)\n", dev));
@@ -417,7 +419,7 @@ static int sound_mmap(struct file *file, struct vm_area_struct *vma)
        int dev_class;
        unsigned long size;
        struct dma_buffparms *dmap = NULL;
-       int dev = iminor(file->f_dentry->d_inode);
+       int dev = iminor(file->f_path.dentry->d_inode);
 
        dev_class = dev & 0x0f;
        dev >>= 4;
@@ -481,7 +483,7 @@ static int sound_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-struct file_operations oss_sound_fops = {
+const struct file_operations oss_sound_fops = {
        .owner          = THIS_MODULE,
        .llseek         = no_llseek,
        .read           = sound_read,
@@ -556,7 +558,7 @@ static int __init oss_init(void)
        /* Protecting the innocent */
        sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
 
-       for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
+       for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
                device_create(sound_class, NULL,
                              MKDEV(SOUND_MAJOR, dev_list[i].minor),
                              "%s", dev_list[i].name);
@@ -580,7 +582,7 @@ static void __exit oss_cleanup(void)
 {
        int i, j;
 
-       for (i = 0; i < sizeof (dev_list) / sizeof *dev_list; i++) {
+       for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
                device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
                if (!dev_list[i].num)
                        continue;