aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/cosa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/cosa.c')
-rw-r--r--drivers/net/wan/cosa.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index e2c33c06190b..b36bf96eb502 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -297,8 +297,8 @@ static ssize_t cosa_write(struct file *file,
297static unsigned int cosa_poll(struct file *file, poll_table *poll); 297static unsigned int cosa_poll(struct file *file, poll_table *poll);
298static int cosa_open(struct inode *inode, struct file *file); 298static int cosa_open(struct inode *inode, struct file *file);
299static int cosa_release(struct inode *inode, struct file *file); 299static int cosa_release(struct inode *inode, struct file *file);
300static int cosa_chardev_ioctl(struct inode *inode, struct file *file, 300static long cosa_chardev_ioctl(struct file *file, unsigned int cmd,
301 unsigned int cmd, unsigned long arg); 301 unsigned long arg);
302#ifdef COSA_FASYNC_WORKING 302#ifdef COSA_FASYNC_WORKING
303static int cosa_fasync(struct inode *inode, struct file *file, int on); 303static int cosa_fasync(struct inode *inode, struct file *file, int on);
304#endif 304#endif
@@ -309,7 +309,7 @@ static const struct file_operations cosa_fops = {
309 .read = cosa_read, 309 .read = cosa_read,
310 .write = cosa_write, 310 .write = cosa_write,
311 .poll = cosa_poll, 311 .poll = cosa_poll,
312 .ioctl = cosa_chardev_ioctl, 312 .unlocked_ioctl = cosa_chardev_ioctl,
313 .open = cosa_open, 313 .open = cosa_open,
314 .release = cosa_release, 314 .release = cosa_release,
315#ifdef COSA_FASYNC_WORKING 315#ifdef COSA_FASYNC_WORKING
@@ -907,6 +907,7 @@ static ssize_t cosa_write(struct file *file,
907 current->state = TASK_RUNNING; 907 current->state = TASK_RUNNING;
908 chan->tx_status = 1; 908 chan->tx_status = 1;
909 spin_unlock_irqrestore(&cosa->lock, flags); 909 spin_unlock_irqrestore(&cosa->lock, flags);
910 up(&chan->wsem);
910 return -ERESTARTSYS; 911 return -ERESTARTSYS;
911 } 912 }
912 } 913 }
@@ -1204,12 +1205,18 @@ static int cosa_net_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1204 return hdlc_ioctl(dev, ifr, cmd); 1205 return hdlc_ioctl(dev, ifr, cmd);
1205} 1206}
1206 1207
1207static int cosa_chardev_ioctl(struct inode *inode, struct file *file, 1208static long cosa_chardev_ioctl(struct file *file, unsigned int cmd,
1208 unsigned int cmd, unsigned long arg) 1209 unsigned long arg)
1209{ 1210{
1210 struct channel_data *channel = file->private_data; 1211 struct channel_data *channel = file->private_data;
1211 struct cosa_data *cosa = channel->cosa; 1212 struct cosa_data *cosa;
1212 return cosa_ioctl_common(cosa, channel, cmd, arg); 1213 long ret;
1214
1215 lock_kernel();
1216 cosa = channel->cosa;
1217 ret = cosa_ioctl_common(cosa, channel, cmd, arg);
1218 unlock_kernel();
1219 return ret;
1213} 1220}
1214 1221
1215 1222