aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorFrank Schaefer <fschaefer.oss@googlemail.com>2012-11-08 12:11:49 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-12-22 15:11:26 -0500
commit0cf544a6cc66b493852d48517ce4833dfade5809 (patch)
tree16870a9e3356a63fed071a6cddadc8141392f551 /drivers/media/usb/em28xx/em28xx-cards.c
parenta950e4a75ea498f2f43c90a41173fdb4235752c9 (diff)
[media] em28xx: rename some USB parameter fields in struct em28xx to clarify their role
Also improve the comments. Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-cards.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index bfce34d491c0..873b52f71ab2 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3183,9 +3183,10 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3183 } 3183 }
3184 3184
3185 /* compute alternate max packet sizes */ 3185 /* compute alternate max packet sizes */
3186 dev->alt_max_pkt_size = kmalloc(sizeof(dev->alt_max_pkt_size[0]) * 3186 dev->alt_max_pkt_size_isoc =
3187 kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) *
3187 interface->num_altsetting, GFP_KERNEL); 3188 interface->num_altsetting, GFP_KERNEL);
3188 if (dev->alt_max_pkt_size == NULL) { 3189 if (dev->alt_max_pkt_size_isoc == NULL) {
3189 em28xx_errdev("out of memory!\n"); 3190 em28xx_errdev("out of memory!\n");
3190 kfree(dev); 3191 kfree(dev);
3191 retval = -ENOMEM; 3192 retval = -ENOMEM;
@@ -3216,13 +3217,14 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3216 break; 3217 break;
3217 case EM28XX_EP_ANALOG: 3218 case EM28XX_EP_ANALOG:
3218 has_video = true; 3219 has_video = true;
3219 dev->alt_max_pkt_size[i] = size; 3220 dev->alt_max_pkt_size_isoc[i] = size;
3220 break; 3221 break;
3221 case EM28XX_EP_DIGITAL: 3222 case EM28XX_EP_DIGITAL:
3222 has_dvb = true; 3223 has_dvb = true;
3223 if (size > dev->dvb_max_pkt_size) { 3224 if (size > dev->dvb_max_pkt_size_isoc) {
3224 dev->dvb_max_pkt_size = size; 3225 dev->dvb_max_pkt_size_isoc =
3225 dev->dvb_alt = i; 3226 size;
3227 dev->dvb_alt_isoc = i;
3226 } 3228 }
3227 break; 3229 break;
3228 } 3230 }
@@ -3324,7 +3326,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3324 /* pre-allocate DVB isoc transfer buffers */ 3326 /* pre-allocate DVB isoc transfer buffers */
3325 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE, 0, 3327 retval = em28xx_alloc_urbs(dev, EM28XX_DIGITAL_MODE, 0,
3326 EM28XX_DVB_NUM_BUFS, 3328 EM28XX_DVB_NUM_BUFS,
3327 dev->dvb_max_pkt_size, 3329 dev->dvb_max_pkt_size_isoc,
3328 EM28XX_DVB_NUM_ISOC_PACKETS); 3330 EM28XX_DVB_NUM_ISOC_PACKETS);
3329 if (retval) { 3331 if (retval) {
3330 goto unlock_and_free; 3332 goto unlock_and_free;
@@ -3344,7 +3346,7 @@ unlock_and_free:
3344 mutex_unlock(&dev->lock); 3346 mutex_unlock(&dev->lock);
3345 3347
3346err_free: 3348err_free:
3347 kfree(dev->alt_max_pkt_size); 3349 kfree(dev->alt_max_pkt_size_isoc);
3348 kfree(dev); 3350 kfree(dev);
3349 3351
3350err: 3352err:
@@ -3409,7 +3411,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
3409 em28xx_close_extension(dev); 3411 em28xx_close_extension(dev);
3410 3412
3411 if (!dev->users) { 3413 if (!dev->users) {
3412 kfree(dev->alt_max_pkt_size); 3414 kfree(dev->alt_max_pkt_size_isoc);
3413 kfree(dev); 3415 kfree(dev);
3414 } 3416 }
3415} 3417}