Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196928
b: refs/heads/master
c: 3504e0c
h: refs/heads/master
v: v3
  • Loading branch information
Eli Lindsey authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 167d7f5 commit 18e2760
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9eafe438051f4dfde53227e609c932642d6dc8f
refs/heads/master: 3504e0c87892c272d9784e12918910d74077da0d
28 changes: 14 additions & 14 deletions trunk/drivers/staging/frontier/alphatrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ MODULE_PARM_DESC(min_interrupt_out_interval,
/* Structure to hold all of our device specific stuff */

struct usb_alphatrack {
struct semaphore sem; /* locks this structure */
struct mutex mtx; /* locks this structure */
struct usb_interface *intf; /* save off the usb interface pointer */
int open_count; /* number of times this port has been opened */

Expand Down Expand Up @@ -347,7 +347,7 @@ static int usb_alphatrack_open(struct inode *inode, struct file *file)
}

/* lock this device */
if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto unlock_disconnect_exit;
}
Expand Down Expand Up @@ -390,7 +390,7 @@ static int usb_alphatrack_open(struct inode *inode, struct file *file)
file->private_data = dev;

unlock_exit:
up(&dev->sem);
mutex_unlock(&dev->mtx);

unlock_disconnect_exit:
mutex_unlock(&disconnect_mutex);
Expand All @@ -413,7 +413,7 @@ static int usb_alphatrack_release(struct inode *inode, struct file *file)
goto exit;
}

if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
Expand All @@ -425,7 +425,7 @@ static int usb_alphatrack_release(struct inode *inode, struct file *file)

if (dev->intf == NULL) {
/* the device was unplugged before the file was released */
up(&dev->sem);
mutex_unlock(&dev->mtx);
/* unlock here as usb_alphatrack_delete frees dev */
usb_alphatrack_delete(dev);
retval = -ENODEV;
Expand All @@ -441,7 +441,7 @@ static int usb_alphatrack_release(struct inode *inode, struct file *file)
dev->open_count = 0;

unlock_exit:
up(&dev->sem);
mutex_unlock(&dev->mtx);

exit:
return retval;
Expand Down Expand Up @@ -486,7 +486,7 @@ static ssize_t usb_alphatrack_read(struct file *file, char __user *buffer,
goto exit;

/* lock this object */
if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
Expand Down Expand Up @@ -532,7 +532,7 @@ static ssize_t usb_alphatrack_read(struct file *file, char __user *buffer,

unlock_exit:
/* unlock the device */
up(&dev->sem);
mutex_unlock(&dev->mtx);

exit:
return retval;
Expand All @@ -556,7 +556,7 @@ static ssize_t usb_alphatrack_write(struct file *file,
goto exit;

/* lock this object */
if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
Expand Down Expand Up @@ -627,7 +627,7 @@ static ssize_t usb_alphatrack_write(struct file *file,

unlock_exit:
/* unlock the device */
up(&dev->sem);
mutex_unlock(&dev->mtx);

exit:
return retval;
Expand Down Expand Up @@ -678,7 +678,7 @@ static int usb_alphatrack_probe(struct usb_interface *intf,
dev_err(&intf->dev, "Out of memory\n");
goto exit;
}
init_MUTEX(&dev->sem);
mutex_init(&dev->mtx);
dev->intf = intf;
init_waitqueue_head(&dev->read_wait);
init_waitqueue_head(&dev->write_wait);
Expand Down Expand Up @@ -835,7 +835,7 @@ static void usb_alphatrack_disconnect(struct usb_interface *intf)
dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL);

down(&dev->sem);
mutex_lock(&dev->mtx);

minor = intf->minor;

Expand All @@ -844,11 +844,11 @@ static void usb_alphatrack_disconnect(struct usb_interface *intf)

/* if the device is not opened, then we clean up right now */
if (!dev->open_count) {
up(&dev->sem);
mutex_unlock(&dev->mtx);
usb_alphatrack_delete(dev);
} else {
dev->intf = NULL;
up(&dev->sem);
mutex_unlock(&dev->mtx);
}

atomic_set(&dev->writes_pending, 0);
Expand Down
28 changes: 14 additions & 14 deletions trunk/drivers/staging/frontier/tranzport.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct tranzport_cmd {
/* Structure to hold all of our device specific stuff */

struct usb_tranzport {
struct semaphore sem; /* locks this structure */
struct mutex mtx; /* locks this structure */
struct usb_interface *intf; /* save off the usb interface pointer */
int open_count; /* number of times this port opened */
struct tranzport_cmd (*ring_buffer)[RING_BUFFER_SIZE];
Expand Down Expand Up @@ -367,7 +367,7 @@ static int usb_tranzport_open(struct inode *inode, struct file *file)
}

/* lock this device */
if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto unlock_disconnect_exit;
}
Expand Down Expand Up @@ -411,7 +411,7 @@ static int usb_tranzport_open(struct inode *inode, struct file *file)
file->private_data = dev;

unlock_exit:
up(&dev->sem);
mutex_unlock(&dev->mtx);

unlock_disconnect_exit:
mutex_unlock(&disconnect_mutex);
Expand All @@ -434,7 +434,7 @@ static int usb_tranzport_release(struct inode *inode, struct file *file)
goto exit;
}

if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
Expand All @@ -446,7 +446,7 @@ static int usb_tranzport_release(struct inode *inode, struct file *file)

if (dev->intf == NULL) {
/* the device was unplugged before the file was released */
up(&dev->sem);
mutex_unlock(&dev->mtx);
/* unlock here as usb_tranzport_delete frees dev */
usb_tranzport_delete(dev);
retval = -ENODEV;
Expand All @@ -462,7 +462,7 @@ static int usb_tranzport_release(struct inode *inode, struct file *file)
dev->open_count = 0;

unlock_exit:
up(&dev->sem);
mutex_unlock(&dev->mtx);

exit:
return retval;
Expand Down Expand Up @@ -512,7 +512,7 @@ static ssize_t usb_tranzport_read(struct file *file, char __user *buffer,
goto exit;

/* lock this object */
if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
Expand Down Expand Up @@ -660,7 +660,7 @@ retval = 8;

unlock_exit:
/* unlock the device */
up(&dev->sem);
mutex_unlock(&dev->mtx);

exit:
return retval;
Expand All @@ -684,7 +684,7 @@ static ssize_t usb_tranzport_write(struct file *file,
goto exit;

/* lock this object */
if (down_interruptible(&dev->sem)) {
if (mutex_lock_interruptible(&dev->mtx)) {
retval = -ERESTARTSYS;
goto exit;
}
Expand Down Expand Up @@ -753,7 +753,7 @@ static ssize_t usb_tranzport_write(struct file *file,

unlock_exit:
/* unlock the device */
up(&dev->sem);
mutex_unlock(&dev->mtx);

exit:
return retval;
Expand Down Expand Up @@ -802,7 +802,7 @@ static int usb_tranzport_probe(struct usb_interface *intf,
dev_err(&intf->dev, "Out of memory\n");
goto exit;
}
init_MUTEX(&dev->sem);
mutex_init(&dev->mtx);
dev->intf = intf;
init_waitqueue_head(&dev->read_wait);
init_waitqueue_head(&dev->write_wait);
Expand Down Expand Up @@ -942,18 +942,18 @@ static void usb_tranzport_disconnect(struct usb_interface *intf)
mutex_lock(&disconnect_mutex);
dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL);
down(&dev->sem);
mutex_lock(&dev->mtx);
minor = intf->minor;
/* give back our minor */
usb_deregister_dev(intf, &usb_tranzport_class);

/* if the device is not opened, then we clean up right now */
if (!dev->open_count) {
up(&dev->sem);
mutex_unlock(&dev->mtx);
usb_tranzport_delete(dev);
} else {
dev->intf = NULL;
up(&dev->sem);
mutex_unlock(&dev->mtx);
}

mutex_unlock(&disconnect_mutex);
Expand Down

0 comments on commit 18e2760

Please sign in to comment.