diff options
author | Ezequiel GarcĂa <elezegarcia@gmail.com> | 2012-02-24 09:24:20 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-15 07:59:57 -0400 |
commit | cf32b65d0589cdbe9bc4cc7081f13ebbae11308c (patch) | |
tree | 7991b7aea60e865d807d867906f2d4d12d4a3b8f /drivers/staging | |
parent | de6ffc5e5a4ce0c4f078eaa2189bc906e8963d11 (diff) |
[media] staging: easycap: Clean comment style in easycap_usb_disconnect()
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/easycap/easycap_main.c | 64 |
1 files changed, 24 insertions, 40 deletions
diff --git a/drivers/staging/media/easycap/easycap_main.c b/drivers/staging/media/easycap/easycap_main.c index 6e1734d8d276..de53ed825f2c 100644 --- a/drivers/staging/media/easycap/easycap_main.c +++ b/drivers/staging/media/easycap/easycap_main.c | |||
@@ -3973,15 +3973,13 @@ static int easycap_usb_probe(struct usb_interface *intf, | |||
3973 | SAM("ends successfully for interface %i\n", bInterfaceNumber); | 3973 | SAM("ends successfully for interface %i\n", bInterfaceNumber); |
3974 | return 0; | 3974 | return 0; |
3975 | } | 3975 | } |
3976 | /*****************************************************************************/ | 3976 | |
3977 | /*---------------------------------------------------------------------------*/ | ||
3978 | /* | 3977 | /* |
3979 | * WHEN THIS FUNCTION IS CALLED THE EasyCAP HAS ALREADY BEEN PHYSICALLY | 3978 | * When this function is called the device has already been |
3980 | * UNPLUGGED. HENCE peasycap->pusb_device IS NO LONGER VALID. | 3979 | * physically unplugged. |
3981 | * | 3980 | * Hence, peasycap->pusb_device is no longer valid. |
3982 | * THIS FUNCTION AFFECTS ALSA. BEWARE. | 3981 | * This function affects alsa. |
3983 | */ | 3982 | */ |
3984 | /*---------------------------------------------------------------------------*/ | ||
3985 | static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | 3983 | static void easycap_usb_disconnect(struct usb_interface *pusb_interface) |
3986 | { | 3984 | { |
3987 | struct usb_host_interface *pusb_host_interface; | 3985 | struct usb_host_interface *pusb_host_interface; |
@@ -4006,6 +4004,7 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4006 | minor = pusb_interface->minor; | 4004 | minor = pusb_interface->minor; |
4007 | JOT(4, "intf[%i]: minor=%i\n", bInterfaceNumber, minor); | 4005 | JOT(4, "intf[%i]: minor=%i\n", bInterfaceNumber, minor); |
4008 | 4006 | ||
4007 | /* There is nothing to do for Interface Number 1 */ | ||
4009 | if (1 == bInterfaceNumber) | 4008 | if (1 == bInterfaceNumber) |
4010 | return; | 4009 | return; |
4011 | 4010 | ||
@@ -4014,11 +4013,8 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4014 | SAY("ERROR: peasycap is NULL\n"); | 4013 | SAY("ERROR: peasycap is NULL\n"); |
4015 | return; | 4014 | return; |
4016 | } | 4015 | } |
4017 | /*---------------------------------------------------------------------------*/ | 4016 | |
4018 | /* | 4017 | /* If the waitqueues are not cleared a deadlock is possible */ |
4019 | * IF THE WAIT QUEUES ARE NOT CLEARED A DEADLOCK IS POSSIBLE. BEWARE. | ||
4020 | */ | ||
4021 | /*---------------------------------------------------------------------------*/ | ||
4022 | peasycap->video_eof = 1; | 4018 | peasycap->video_eof = 1; |
4023 | peasycap->audio_eof = 1; | 4019 | peasycap->audio_eof = 1; |
4024 | wake_up_interruptible(&(peasycap->wq_video)); | 4020 | wake_up_interruptible(&(peasycap->wq_video)); |
@@ -4034,15 +4030,14 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4034 | default: | 4030 | default: |
4035 | break; | 4031 | break; |
4036 | } | 4032 | } |
4037 | /*--------------------------------------------------------------------------*/ | 4033 | |
4038 | /* | 4034 | /* |
4039 | * DEREGISTER | 4035 | * Deregister |
4040 | * | 4036 | * This procedure will block until easycap_poll(), |
4041 | * THIS PROCEDURE WILL BLOCK UNTIL easycap_poll(), VIDEO IOCTL AND AUDIO | 4037 | * video and audio ioctl are all unlocked. |
4042 | * IOCTL ARE ALL UNLOCKED. IF THIS IS NOT DONE AN Oops CAN OCCUR WHEN | 4038 | * If this is not done an oops can occur when an easycap |
4043 | * AN EasyCAP IS UNPLUGGED WHILE THE URBS ARE RUNNING. BEWARE. | 4039 | * is unplugged while the urbs are running. |
4044 | */ | 4040 | */ |
4045 | /*--------------------------------------------------------------------------*/ | ||
4046 | kd = easycap_isdongle(peasycap); | 4041 | kd = easycap_isdongle(peasycap); |
4047 | switch (bInterfaceNumber) { | 4042 | switch (bInterfaceNumber) { |
4048 | case 0: { | 4043 | case 0: { |
@@ -4059,7 +4054,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4059 | } else { | 4054 | } else { |
4060 | SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd); | 4055 | SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd); |
4061 | } | 4056 | } |
4062 | /*---------------------------------------------------------------------------*/ | ||
4063 | if (!peasycap->v4l2_device.name[0]) { | 4057 | if (!peasycap->v4l2_device.name[0]) { |
4064 | SAM("ERROR: peasycap->v4l2_device.name is empty\n"); | 4058 | SAM("ERROR: peasycap->v4l2_device.name is empty\n"); |
4065 | if (0 <= kd && DONGLE_MANY > kd) | 4059 | if (0 <= kd && DONGLE_MANY > kd) |
@@ -4075,7 +4069,6 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4075 | JOM(4, "intf[%i]: video_unregister_device() minor=%i\n", | 4069 | JOM(4, "intf[%i]: video_unregister_device() minor=%i\n", |
4076 | bInterfaceNumber, minor); | 4070 | bInterfaceNumber, minor); |
4077 | peasycap->registered_video--; | 4071 | peasycap->registered_video--; |
4078 | /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ | ||
4079 | 4072 | ||
4080 | if (0 <= kd && DONGLE_MANY > kd) { | 4073 | if (0 <= kd && DONGLE_MANY > kd) { |
4081 | mutex_unlock(&easycapdc60_dongle[kd].mutex_video); | 4074 | mutex_unlock(&easycapdc60_dongle[kd].mutex_video); |
@@ -4111,12 +4104,12 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4111 | default: | 4104 | default: |
4112 | break; | 4105 | break; |
4113 | } | 4106 | } |
4114 | /*---------------------------------------------------------------------------*/ | 4107 | |
4115 | /* | 4108 | /* |
4116 | * CALL easycap_delete() IF NO REMAINING REFERENCES TO peasycap | 4109 | * If no remaining references to peasycap, |
4117 | * (ALSO WHEN ALSA HAS BEEN IN USE) | 4110 | * call easycap_delete. |
4118 | */ | 4111 | * (Also when alsa has been in use) |
4119 | /*---------------------------------------------------------------------------*/ | 4112 | */ |
4120 | if (!peasycap->kref.refcount.counter) { | 4113 | if (!peasycap->kref.refcount.counter) { |
4121 | SAM("ERROR: peasycap->kref.refcount.counter is zero " | 4114 | SAM("ERROR: peasycap->kref.refcount.counter is zero " |
4122 | "so cannot call kref_put()\n"); | 4115 | "so cannot call kref_put()\n"); |
@@ -4151,17 +4144,11 @@ static void easycap_usb_disconnect(struct usb_interface *pusb_interface) | |||
4151 | mutex_unlock(&easycapdc60_dongle[kd].mutex_video); | 4144 | mutex_unlock(&easycapdc60_dongle[kd].mutex_video); |
4152 | JOT(4, "unlocked dongle[%i].mutex_video\n", kd); | 4145 | JOT(4, "unlocked dongle[%i].mutex_video\n", kd); |
4153 | } | 4146 | } |
4154 | /*---------------------------------------------------------------------------*/ | ||
4155 | JOM(4, "ends\n"); | 4147 | JOM(4, "ends\n"); |
4156 | return; | 4148 | return; |
4157 | } | 4149 | } |
4158 | /*****************************************************************************/ | ||
4159 | 4150 | ||
4160 | /*---------------------------------------------------------------------------*/ | 4151 | /* Devices supported by this driver */ |
4161 | /* | ||
4162 | * PARAMETERS APPLICABLE TO ENTIRE DRIVER, I.E. BOTH VIDEO AND AUDIO | ||
4163 | */ | ||
4164 | /*---------------------------------------------------------------------------*/ | ||
4165 | static struct usb_device_id easycap_usb_device_id_table[] = { | 4152 | static struct usb_device_id easycap_usb_device_id_table[] = { |
4166 | {USB_DEVICE(USB_EASYCAP_VENDOR_ID, USB_EASYCAP_PRODUCT_ID)}, | 4153 | {USB_DEVICE(USB_EASYCAP_VENDOR_ID, USB_EASYCAP_PRODUCT_ID)}, |
4167 | { } | 4154 | { } |
@@ -4196,14 +4183,11 @@ static int __init easycap_module_init(void) | |||
4196 | 4183 | ||
4197 | return rc; | 4184 | return rc; |
4198 | } | 4185 | } |
4199 | /*****************************************************************************/ | 4186 | |
4200 | static void __exit easycap_module_exit(void) | 4187 | static void __exit easycap_module_exit(void) |
4201 | { | 4188 | { |
4202 | usb_deregister(&easycap_usb_driver); | 4189 | usb_deregister(&easycap_usb_driver); |
4203 | } | 4190 | } |
4204 | /*****************************************************************************/ | ||
4205 | 4191 | ||
4206 | module_init(easycap_module_init); | 4192 | module_init(easycap_module_init); |
4207 | module_exit(easycap_module_exit); | 4193 | module_exit(easycap_module_exit); |
4208 | |||
4209 | /*****************************************************************************/ | ||