mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
bcm2708-vcio: Remove restriction of only a single instance being open
We need more than one process to be able to use mailbox interface (e.g. HW cursor in fbturbo and hello_fft). Locking should be handled on each mailbox access
This commit is contained in:
@@ -242,20 +242,9 @@ EXPORT_SYMBOL_GPL(bcm_mailbox_property);
|
||||
|
||||
/* Platform Device for Mailbox */
|
||||
|
||||
/*
|
||||
* Is the device open right now? Used to prevent
|
||||
* concurent access into the same device
|
||||
*/
|
||||
static bool device_is_open;
|
||||
|
||||
/* This is called whenever a process attempts to open the device file */
|
||||
static int device_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
/* We don't want to talk to two processes at the same time */
|
||||
if (device_is_open)
|
||||
return -EBUSY;
|
||||
|
||||
device_is_open = true;
|
||||
try_module_get(THIS_MODULE);
|
||||
|
||||
return 0;
|
||||
@@ -263,9 +252,6 @@ static int device_open(struct inode *inode, struct file *file)
|
||||
|
||||
static int device_release(struct inode *inode, struct file *file)
|
||||
{
|
||||
/* We're now ready for our next caller */
|
||||
device_is_open = false;
|
||||
|
||||
module_put(THIS_MODULE);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user