--- drivers/dahdi/dahdi-base.c.orig 2011-01-12 15:38:44.000000000 +0200 +++ drivers/dahdi/dahdi-base.c 2011-01-12 16:44:33.000000000 +0200 @@ -48,10 +48,6 @@ #include #include -#ifdef HAVE_UNLOCKED_IOCTL -#include -#endif - #include #include @@ -5838,22 +5834,13 @@ return 0; } -#ifdef HAVE_UNLOCKED_IOCTL -static long dahdi_ioctl(struct file *file, unsigned int cmd, unsigned long data) -#else -static int dahdi_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long data) -#endif +static long dahdi_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long data) { int unit = UNIT(file); struct dahdi_chan *chan; struct dahdi_timer *timer; int ret; -#ifdef HAVE_UNLOCKED_IOCTL - lock_kernel(); -#endif - if (!unit) { ret = dahdi_ctl_ioctl(file, cmd, data); goto unlock_exit; @@ -5896,12 +5883,17 @@ ret = dahdi_chan_ioctl(file, cmd, data, unit); unlock_exit: -#ifdef HAVE_UNLOCKED_IOCTL - unlock_kernel(); -#endif return ret; } +#ifndef HAVE_UNLOCKED_IOCTL +static int dahdi_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long data) +{ + return dahdi_unlocked_ioctl(file, cmd, data); +} +#endif + #ifdef HAVE_COMPAT_IOCTL static long dahdi_ioctl_compat(struct file *file, unsigned int cmd, unsigned long data) @@ -5909,7 +5901,7 @@ if (cmd == DAHDI_SFCONFIG) return -ENOTTY; /* Not supported yet */ - return dahdi_ioctl(file, cmd, data); + return dahdi_unlocked_ioctl(file, cmd, data); } #endif @@ -8603,7 +8595,7 @@ .open = dahdi_open, .release = dahdi_release, #ifdef HAVE_UNLOCKED_IOCTL - .unlocked_ioctl = dahdi_ioctl, + .unlocked_ioctl = dahdi_unlocked_ioctl, #ifdef HAVE_COMPAT_IOCTL .compat_ioctl = dahdi_ioctl_compat, #endif