From: Kitae Kim Date: Mon, 4 Jun 2012 11:48:42 +0000 (+0900) Subject: [Title] Modify vdpram source to enable telephony module. X-Git-Tag: 2.2.1_release^2~133 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ae32d9437ecb6b2c26043227082fc09737927e33;p=sdk%2Femulator%2Femulator-kernel.git [Title] Modify vdpram source to enable telephony module. [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] --- diff --git a/arch/x86/configs/i386_emul_defconfig b/arch/x86/configs/i386_emul_defconfig index b1e51b19ac5d..c704c5fd867d 100644 --- a/arch/x86/configs/i386_emul_defconfig +++ b/arch/x86/configs/i386_emul_defconfig @@ -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 diff --git a/drivers/char/vdpram.c b/drivers/char/vdpram.c index d9418e95a3b5..eb5c9305b696 100755 --- a/drivers/char/vdpram.c +++ b/drivers/char/vdpram.c @@ -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;