[Title] Modify vdpram source to enable telephony module.
authorKitae Kim <kt920.kim@samsung.com>
Mon, 4 Jun 2012 11:48:42 +0000 (20:48 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Mon, 4 Jun 2012 11:48:42 +0000 (20:48 +0900)
[Type] bug fix
[Module] emulator-kernel / vdpram
[Priority]
[CQ#]
[Redmine#]
[Problem] ioctl function signature has been changed on kernel 3.x
[Cause]
[Solution] change ioctl to unlocked_ioctl
[TestCase]

arch/x86/configs/i386_emul_defconfig
drivers/char/vdpram.c

index b1e51b19ac5d85f414d3787eff315b5781034fc5..c704c5fd867d3eeb27df1c019149b49f9cb85780 100644 (file)
@@ -1646,7 +1646,7 @@ CONFIG_HPET=y
 # CONFIG_TELCLOCK is not set
 CONFIG_DEVPORT=y
 # CONFIG_RAMOOPS is not set
-# CONFIG_VDPRAM_DEVICE is not set
+CONFIG_VDPRAM_DEVICE=y
 CONFIG_VIRTIOGL=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
index d9418e95a3b50f11f87b3c4f1dff6f3efd5202df..eb5c9305b696834b6496233889739567a2c09140 100755 (executable)
@@ -108,8 +108,7 @@ static struct queue_t *queue;
 static int vdpram_fasync(int fd, struct file *filp, int mode);
 static int spacefree(struct vdpram_dev *dev);
 
-int vdpram_ioctl(struct inode *inode, struct file *filp,
-                 unsigned int cmd,  unsigned long  arg);
+long vdpram_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
 
 /* Open and close */
 static int vdpram_open(struct inode *inode, struct file *filp)
@@ -117,8 +116,6 @@ static int vdpram_open(struct inode *inode, struct file *filp)
        struct vdpram_dev *dev;
        int index;
 
-
-
        dev = container_of(inode->i_cdev, struct vdpram_dev, cdev);
        filp->private_data = dev;
        index = dev->index ;
@@ -502,7 +499,7 @@ struct file_operations vdpram_even_fops = {
        .open =         vdpram_open,
        .release =      vdpram_release,
        .fasync =       vdpram_fasync,
-       .ioctl =        vdpram_ioctl,
+       .unlocked_ioctl = vdpram_ioctl,
 };
 
 struct file_operations vdpram_odd_fops = {
@@ -514,18 +511,16 @@ struct file_operations vdpram_odd_fops = {
        .open =         vdpram_open,
        .release =      vdpram_release,
        .fasync =       vdpram_fasync,
-       .ioctl =        vdpram_ioctl,
+       .unlocked_ioctl = vdpram_ioctl,
 };
 
-int vdpram_ioctl(struct inode *inode, struct file *filp,
-                 unsigned int cmd, unsigned long arg)
+long vdpram_ioctl(struct file* filp, unsigned int cmd, unsigned long arg)
 {
        struct vdpram_dev *dev;
        struct vdpram_status_dev dev_status;
        int index;
 
-       dev = container_of(inode->i_cdev, struct vdpram_dev, cdev);
-       filp->private_data = dev;
+       dev = (struct vdpram_dev*)filp->private_data;
        index = dev->index ;
 
        memset( &dev_status, 0, sizeof(struct vdpram_status_dev));
@@ -642,7 +637,8 @@ int vdpram_init(void)
        memset(queue, 0, vdpram_nr_devs * sizeof(struct queue_t));
        for (i = 0; i < vdpram_nr_devs; i++) {
 #ifdef VDPRAM_LOCK_ENABLE
-               init_MUTEX(&buffer[i].sem);
+//             init_MUTEX(&buffer[i].sem);
+               sema_init(&buffer[i].sem, 1);
 #endif //VDPRAM_LOCK_ENABLE
                buffer[i].begin = kmalloc(vdpram_buffer, GFP_KERNEL);
                buffer[i].buffersize = vdpram_buffer;