diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-09 09:41:59 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-12-10 06:22:53 -0500 |
commit | a1ed551cdb4f29157466340760fde68bcda704a9 (patch) | |
tree | 9e749237583521420175e485522de346db4f468d /drivers/media | |
parent | 7ca659e3c1c3dd67073751385ae3bd25b27526bb (diff) |
V4L/DVB (4941): Remove LINUX_VERSION_CODE and fix identations
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/usbvision/usbvision-core.c | 22 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-i2c.c | 14 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 26 |
3 files changed, 14 insertions, 48 deletions
diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index cf5d4771312d..e660a91d8251 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c | |||
@@ -47,8 +47,8 @@ | |||
47 | #include <media/tuner.h> | 47 | #include <media/tuner.h> |
48 | #include <media/audiochip.h> | 48 | #include <media/audiochip.h> |
49 | 49 | ||
50 | #include <linux/moduleparam.h> | 50 | #include <linux/moduleparam.h> |
51 | #include <linux/workqueue.h> | 51 | #include <linux/workqueue.h> |
52 | 52 | ||
53 | #ifdef CONFIG_KMOD | 53 | #ifdef CONFIG_KMOD |
54 | #include <linux/kmod.h> | 54 | #include <linux/kmod.h> |
@@ -1397,7 +1397,7 @@ static int usbvision_compress_isochronous(struct usb_usbvision *usbvision, | |||
1397 | return totlen; | 1397 | return totlen; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | static void usbvision_isocIrq(struct urb *urb, struct pt_regs *regs) | 1400 | static void usbvision_isocIrq(struct urb *urb) |
1401 | { | 1401 | { |
1402 | int errCode = 0; | 1402 | int errCode = 0; |
1403 | int len; | 1403 | int len; |
@@ -1529,7 +1529,7 @@ int usbvision_write_reg(struct usb_usbvision *usbvision, unsigned char reg, | |||
1529 | } | 1529 | } |
1530 | 1530 | ||
1531 | 1531 | ||
1532 | static void usbvision_ctrlUrb_complete(struct urb *urb, struct pt_regs *regs) | 1532 | static void usbvision_ctrlUrb_complete(struct urb *urb) |
1533 | { | 1533 | { |
1534 | struct usb_usbvision *usbvision = (struct usb_usbvision *)urb->context; | 1534 | struct usb_usbvision *usbvision = (struct usb_usbvision *)urb->context; |
1535 | 1535 | ||
@@ -2416,11 +2416,7 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2416 | int j, k; | 2416 | int j, k; |
2417 | struct urb *urb; | 2417 | struct urb *urb; |
2418 | 2418 | ||
2419 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | 2419 | urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL); |
2420 | urb = usb_alloc_urb(USBVISION_URB_FRAMES); | ||
2421 | #else | ||
2422 | urb = usb_alloc_urb(USBVISION_URB_FRAMES, GFP_KERNEL); | ||
2423 | #endif | ||
2424 | if (urb == NULL) { | 2420 | if (urb == NULL) { |
2425 | err("%s: usb_alloc_urb() failed", __FUNCTION__); | 2421 | err("%s: usb_alloc_urb() failed", __FUNCTION__); |
2426 | return -ENOMEM; | 2422 | return -ENOMEM; |
@@ -2429,12 +2425,8 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2429 | urb->dev = dev; | 2425 | urb->dev = dev; |
2430 | urb->context = usbvision; | 2426 | urb->context = usbvision; |
2431 | urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp); | 2427 | urb->pipe = usb_rcvisocpipe(dev, usbvision->video_endp); |
2432 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | ||
2433 | urb->transfer_flags = USB_ISO_ASAP; | ||
2434 | #else | ||
2435 | urb->transfer_flags = URB_ISO_ASAP; | 2428 | urb->transfer_flags = URB_ISO_ASAP; |
2436 | urb->interval = 1; | 2429 | urb->interval = 1; |
2437 | #endif | ||
2438 | urb->transfer_buffer = usbvision->sbuf[bufIdx].data; | 2430 | urb->transfer_buffer = usbvision->sbuf[bufIdx].data; |
2439 | urb->complete = usbvision_isocIrq; | 2431 | urb->complete = usbvision_isocIrq; |
2440 | urb->number_of_packets = USBVISION_URB_FRAMES; | 2432 | urb->number_of_packets = USBVISION_URB_FRAMES; |
@@ -2450,11 +2442,7 @@ int usbvision_init_isoc(struct usb_usbvision *usbvision) | |||
2450 | 2442 | ||
2451 | /* Submit all URBs */ | 2443 | /* Submit all URBs */ |
2452 | for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { | 2444 | for (bufIdx = 0; bufIdx < USBVISION_NUMSBUF; bufIdx++) { |
2453 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | ||
2454 | errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb); | ||
2455 | #else | ||
2456 | errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb, GFP_KERNEL); | 2445 | errCode = usb_submit_urb(usbvision->sbuf[bufIdx].urb, GFP_KERNEL); |
2457 | #endif | ||
2458 | if (errCode) { | 2446 | if (errCode) { |
2459 | err("%s: usb_submit_urb(%d) failed: error %d", __FUNCTION__, bufIdx, errCode); | 2447 | err("%s: usb_submit_urb(%d) failed: error %d", __FUNCTION__, bufIdx, errCode); |
2460 | } | 2448 | } |
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c index 2de74e48cbe5..92bf9a1f1e2c 100644 --- a/drivers/media/video/usbvision/usbvision-i2c.c +++ b/drivers/media/video/usbvision/usbvision-i2c.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/slab.h> | 30 | #include <linux/slab.h> |
31 | #include <linux/version.h> | 31 | #include <linux/version.h> |
32 | #include <linux/utsname.h> | 32 | #include <linux/utsname.h> |
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
35 | #include <linux/ioport.h> | 35 | #include <linux/ioport.h> |
@@ -350,13 +350,9 @@ static int detach_inform(struct i2c_client *client) | |||
350 | { | 350 | { |
351 | struct usb_usbvision *usbvision; | 351 | struct usb_usbvision *usbvision; |
352 | 352 | ||
353 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) | 353 | usbvision = (struct usb_usbvision *)i2c_get_adapdata(client->adapter); |
354 | usbvision = (struct usb_usbvision *)client->adapter->data; | ||
355 | #else | ||
356 | usbvision = (struct usb_usbvision *)i2c_get_adapdata(client->adapter); | ||
357 | #endif | ||
358 | 354 | ||
359 | PDEBUG(DBG_I2C,"usbvision[%d] detaches %s", usbvision->nr, client->name); | 355 | PDEBUG(DBG_I2C,"usbvision[%d] detaches %s", usbvision->nr, client->name); |
360 | return 0; | 356 | return 0; |
361 | } | 357 | } |
362 | 358 | ||
@@ -548,9 +544,9 @@ static struct i2c_adapter i2c_adap_template = { | |||
548 | .algo_data = NULL, | 544 | .algo_data = NULL, |
549 | .client_register = attach_inform, | 545 | .client_register = attach_inform, |
550 | .client_unregister = detach_inform, | 546 | .client_unregister = detach_inform, |
551 | #if defined (I2C_ADAP_CLASS_TV_ANALOG) | 547 | #ifdef I2C_ADAP_CLASS_TV_ANALOG |
552 | .class = I2C_ADAP_CLASS_TV_ANALOG, | 548 | .class = I2C_ADAP_CLASS_TV_ANALOG, |
553 | #elif defined (I2C_CLASS_TV_ANALOG) | 549 | #else |
554 | .class = I2C_CLASS_TV_ANALOG, | 550 | .class = I2C_CLASS_TV_ANALOG, |
555 | #endif | 551 | #endif |
556 | }; | 552 | }; |
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index ab29ddb68265..1285b93d0ebe 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c | |||
@@ -68,8 +68,8 @@ | |||
68 | #include <media/tuner.h> | 68 | #include <media/tuner.h> |
69 | #include <media/audiochip.h> | 69 | #include <media/audiochip.h> |
70 | 70 | ||
71 | #include <linux/moduleparam.h> | 71 | #include <linux/moduleparam.h> |
72 | #include <linux/workqueue.h> | 72 | #include <linux/workqueue.h> |
73 | 73 | ||
74 | #ifdef CONFIG_KMOD | 74 | #ifdef CONFIG_KMOD |
75 | #include <linux/kmod.h> | 75 | #include <linux/kmod.h> |
@@ -189,8 +189,8 @@ MODULE_PARM_DESC(CustomDevice, " Define the fine tuning parameters for the devic | |||
189 | MODULE_AUTHOR(DRIVER_AUTHOR); | 189 | MODULE_AUTHOR(DRIVER_AUTHOR); |
190 | MODULE_DESCRIPTION(DRIVER_DESC); | 190 | MODULE_DESCRIPTION(DRIVER_DESC); |
191 | MODULE_LICENSE(DRIVER_LICENSE); | 191 | MODULE_LICENSE(DRIVER_LICENSE); |
192 | MODULE_VERSION(USBVISION_VERSION_STRING); | 192 | MODULE_VERSION(USBVISION_VERSION_STRING); |
193 | MODULE_ALIAS(DRIVER_ALIAS); | 193 | MODULE_ALIAS(DRIVER_ALIAS); |
194 | 194 | ||
195 | 195 | ||
196 | /****************************************************************************************/ | 196 | /****************************************************************************************/ |
@@ -1430,9 +1430,7 @@ static int usbvision_vbi_ioctl(struct inode *inode, struct file *file, | |||
1430 | 1430 | ||
1431 | // Video template | 1431 | // Video template |
1432 | static struct file_operations usbvision_fops = { | 1432 | static struct file_operations usbvision_fops = { |
1433 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31) | ||
1434 | .owner = THIS_MODULE, | 1433 | .owner = THIS_MODULE, |
1435 | #endif | ||
1436 | .open = usbvision_v4l2_open, | 1434 | .open = usbvision_v4l2_open, |
1437 | .release = usbvision_v4l2_close, | 1435 | .release = usbvision_v4l2_close, |
1438 | .read = usbvision_v4l2_read, | 1436 | .read = usbvision_v4l2_read, |
@@ -1441,25 +1439,19 @@ static struct file_operations usbvision_fops = { | |||
1441 | .llseek = no_llseek, | 1439 | .llseek = no_llseek, |
1442 | }; | 1440 | }; |
1443 | static struct video_device usbvision_video_template = { | 1441 | static struct video_device usbvision_video_template = { |
1444 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31) | ||
1445 | .owner = THIS_MODULE, | 1442 | .owner = THIS_MODULE, |
1446 | #endif | ||
1447 | .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE, | 1443 | .type = VID_TYPE_TUNER | VID_TYPE_CAPTURE, |
1448 | .hardware = VID_HARDWARE_USBVISION, | 1444 | .hardware = VID_HARDWARE_USBVISION, |
1449 | .fops = &usbvision_fops, | 1445 | .fops = &usbvision_fops, |
1450 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1451 | .name = "usbvision-video", | 1446 | .name = "usbvision-video", |
1452 | .release = video_device_release, | 1447 | .release = video_device_release, |
1453 | #endif | ||
1454 | .minor = -1, | 1448 | .minor = -1, |
1455 | }; | 1449 | }; |
1456 | 1450 | ||
1457 | 1451 | ||
1458 | // Radio template | 1452 | // Radio template |
1459 | static struct file_operations usbvision_radio_fops = { | 1453 | static struct file_operations usbvision_radio_fops = { |
1460 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31) | ||
1461 | .owner = THIS_MODULE, | 1454 | .owner = THIS_MODULE, |
1462 | #endif | ||
1463 | .open = usbvision_radio_open, | 1455 | .open = usbvision_radio_open, |
1464 | .release = usbvision_radio_close, | 1456 | .release = usbvision_radio_close, |
1465 | .ioctl = usbvision_radio_ioctl, | 1457 | .ioctl = usbvision_radio_ioctl, |
@@ -1468,25 +1460,19 @@ static struct file_operations usbvision_radio_fops = { | |||
1468 | 1460 | ||
1469 | static struct video_device usbvision_radio_template= | 1461 | static struct video_device usbvision_radio_template= |
1470 | { | 1462 | { |
1471 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31) | ||
1472 | .owner = THIS_MODULE, | 1463 | .owner = THIS_MODULE, |
1473 | #endif | ||
1474 | .type = VID_TYPE_TUNER, | 1464 | .type = VID_TYPE_TUNER, |
1475 | .hardware = VID_HARDWARE_USBVISION, | 1465 | .hardware = VID_HARDWARE_USBVISION, |
1476 | .fops = &usbvision_radio_fops, | 1466 | .fops = &usbvision_radio_fops, |
1477 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1478 | .release = video_device_release, | 1467 | .release = video_device_release, |
1479 | .name = "usbvision-radio", | 1468 | .name = "usbvision-radio", |
1480 | #endif | ||
1481 | .minor = -1, | 1469 | .minor = -1, |
1482 | }; | 1470 | }; |
1483 | 1471 | ||
1484 | 1472 | ||
1485 | // vbi template | 1473 | // vbi template |
1486 | static struct file_operations usbvision_vbi_fops = { | 1474 | static struct file_operations usbvision_vbi_fops = { |
1487 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31) | ||
1488 | .owner = THIS_MODULE, | 1475 | .owner = THIS_MODULE, |
1489 | #endif | ||
1490 | .open = usbvision_vbi_open, | 1476 | .open = usbvision_vbi_open, |
1491 | .release = usbvision_vbi_close, | 1477 | .release = usbvision_vbi_close, |
1492 | .ioctl = usbvision_vbi_ioctl, | 1478 | .ioctl = usbvision_vbi_ioctl, |
@@ -1495,16 +1481,12 @@ static struct file_operations usbvision_vbi_fops = { | |||
1495 | 1481 | ||
1496 | static struct video_device usbvision_vbi_template= | 1482 | static struct video_device usbvision_vbi_template= |
1497 | { | 1483 | { |
1498 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,31) | ||
1499 | .owner = THIS_MODULE, | 1484 | .owner = THIS_MODULE, |
1500 | #endif | ||
1501 | .type = VID_TYPE_TUNER, | 1485 | .type = VID_TYPE_TUNER, |
1502 | .hardware = VID_HARDWARE_USBVISION, | 1486 | .hardware = VID_HARDWARE_USBVISION, |
1503 | .fops = &usbvision_vbi_fops, | 1487 | .fops = &usbvision_vbi_fops, |
1504 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) | ||
1505 | .release = video_device_release, | 1488 | .release = video_device_release, |
1506 | .name = "usbvision-vbi", | 1489 | .name = "usbvision-vbi", |
1507 | #endif | ||
1508 | .minor = -1, | 1490 | .minor = -1, |
1509 | }; | 1491 | }; |
1510 | 1492 | ||