Re: [PATCH] tty: the briq panel isn't a tty, make it use its ownlocking

From: Jiri Slaby
Date: Thu Feb 23 2012 - 07:37:34 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/