Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219183
b: refs/heads/master
c: cf9b475
h: refs/heads/master
i:
  219181: 1c0e49c
  219179: 7d682a1
  219175: fd21477
  219167: 27855e7
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 40ecd33 commit 72960a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 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: e69e34e9d964b66013dc09a112e6b46def0af1ef
refs/heads/master: cf9b475d5f9b58c23aca76b367f8318743d064e9
17 changes: 8 additions & 9 deletions trunk/drivers/media/radio/si470x/radio-si470x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ int si470x_fops_open(struct file *file)
struct si470x_device *radio = video_drvdata(file);
int retval;

lock_kernel();
mutex_lock(&radio->lock);
radio->users++;

retval = usb_autopm_get_interface(radio->intf);
Expand Down Expand Up @@ -558,7 +558,7 @@ int si470x_fops_open(struct file *file)
}

done:
unlock_kernel();
mutex_unlock(&radio->lock);
return retval;
}

Expand All @@ -577,7 +577,7 @@ int si470x_fops_release(struct file *file)
goto done;
}

mutex_lock(&radio->disconnect_lock);
mutex_lock(&radio->lock);
radio->users--;
if (radio->users == 0) {
/* shutdown interrupt handler */
Expand All @@ -591,7 +591,7 @@ int si470x_fops_release(struct file *file)
video_unregister_device(radio->videodev);
kfree(radio->int_in_buffer);
kfree(radio->buffer);
mutex_unlock(&radio->disconnect_lock);
mutex_unlock(&radio->lock);
kfree(radio);
goto done;
}
Expand All @@ -603,7 +603,7 @@ int si470x_fops_release(struct file *file)
retval = si470x_stop(radio);
usb_autopm_put_interface(radio->intf);
}
mutex_unlock(&radio->disconnect_lock);
mutex_unlock(&radio->lock);
done:
return retval;
}
Expand Down Expand Up @@ -661,7 +661,6 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->disconnected = 0;
radio->usbdev = interface_to_usbdev(intf);
radio->intf = intf;
mutex_init(&radio->disconnect_lock);
mutex_init(&radio->lock);

iface_desc = intf->cur_altsetting;
Expand Down Expand Up @@ -830,7 +829,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf)
{
struct si470x_device *radio = usb_get_intfdata(intf);

mutex_lock(&radio->disconnect_lock);
mutex_lock(&radio->lock);
radio->disconnected = 1;
usb_set_intfdata(intf, NULL);
if (radio->users == 0) {
Expand All @@ -843,10 +842,10 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf)
kfree(radio->int_in_buffer);
video_unregister_device(radio->videodev);
kfree(radio->buffer);
mutex_unlock(&radio->disconnect_lock);
mutex_unlock(&radio->lock);
kfree(radio);
} else {
mutex_unlock(&radio->disconnect_lock);
mutex_unlock(&radio->lock);
}
}

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/media/radio/si470x/radio-si470x.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ struct si470x_device {

/* driver management */
unsigned char disconnected;
struct mutex disconnect_lock;
#endif

#if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE)
Expand Down

0 comments on commit 72960a5

Please sign in to comment.