lkml.org 
[lkml]   [2012]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: the briq panel isn't a tty, make it use its own locking
On 02/23/2012 01:34 PM, Alan Cox wrote:
> --- a/drivers/char/briq_panel.c
> +++ b/drivers/char/briq_panel.c
...
> @@ -66,37 +67,28 @@ static void set_led(char state)
>
> static int briq_panel_open(struct inode *ino, struct file *filep)
> {
> - tty_lock();
> - /* enforce single access, vfd_is_open is protected by BKL */
> - if (vfd_is_open) {
> + /* enforce single open */
> + if (test_and_set_bit(0, &vfd_is_open)) {
> tty_unlock();

This one should be removed too.

> return -EBUSY;
> }
> - vfd_is_open = 1;
> -
> - tty_unlock();
> return 0;
> }

thanks,
--
js
suse labs


\
 
 \ /
  Last update: 2012-02-23 13:39    [W:0.072 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site