diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-14 20:31:54 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-14 20:31:54 -0400 |
commit | 6dc6472581f693b5fc95aebedf67b4960fb85cf0 (patch) | |
tree | 06a5a9a08519950575505273eabced331ed51405 /drivers/media/video/se401.c | |
parent | ee673eaa72d8d185012b1027a05e25aba18c267f (diff) | |
parent | 8acd3a60bcca17c6d89c73cee3ad6057eb83ba1e (diff) |
Merge commit 'origin'
Manual fixup of conflicts on:
arch/powerpc/include/asm/dcr-regs.h
drivers/net/ibm_newemac/core.h
Diffstat (limited to 'drivers/media/video/se401.c')
-rw-r--r-- | drivers/media/video/se401.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index acceed5d04ae..ae3949180c4e 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c | |||
@@ -288,7 +288,7 @@ static void se401_button_irq(struct urb *urb) | |||
288 | int status; | 288 | int status; |
289 | 289 | ||
290 | if (!se401->dev) { | 290 | if (!se401->dev) { |
291 | info("ohoh: device vapourished"); | 291 | dev_info(&urb->dev->dev, "device vapourished\n"); |
292 | return; | 292 | return; |
293 | } | 293 | } |
294 | 294 | ||
@@ -328,7 +328,7 @@ static void se401_video_irq(struct urb *urb) | |||
328 | return; | 328 | return; |
329 | 329 | ||
330 | if (!se401->dev) { | 330 | if (!se401->dev) { |
331 | info ("ohoh: device vapourished"); | 331 | dev_info(&urb->dev->dev, "device vapourished\n"); |
332 | return; | 332 | return; |
333 | } | 333 | } |
334 | 334 | ||
@@ -375,7 +375,7 @@ static void se401_video_irq(struct urb *urb) | |||
375 | urb->status=0; | 375 | urb->status=0; |
376 | urb->dev=se401->dev; | 376 | urb->dev=se401->dev; |
377 | if(usb_submit_urb(urb, GFP_KERNEL)) | 377 | if(usb_submit_urb(urb, GFP_KERNEL)) |
378 | info("urb burned down"); | 378 | dev_info(&urb->dev->dev, "urb burned down\n"); |
379 | return; | 379 | return; |
380 | } | 380 | } |
381 | 381 | ||
@@ -860,7 +860,8 @@ static int se401_newframe(struct usb_se401 *se401, int framenr) | |||
860 | ); | 860 | ); |
861 | if (se401->nullpackets > SE401_MAX_NULLPACKETS) { | 861 | if (se401->nullpackets > SE401_MAX_NULLPACKETS) { |
862 | se401->nullpackets=0; | 862 | se401->nullpackets=0; |
863 | info("to many null length packets, restarting capture"); | 863 | dev_info(&se401->dev->dev, |
864 | "too many null length packets, restarting capture\n"); | ||
864 | se401_stop_stream(se401); | 865 | se401_stop_stream(se401); |
865 | se401_start_stream(se401); | 866 | se401_start_stream(se401); |
866 | } else { | 867 | } else { |
@@ -880,7 +881,8 @@ static int se401_newframe(struct usb_se401 *se401, int framenr) | |||
880 | se401->scratch_use=0; | 881 | se401->scratch_use=0; |
881 | if (errors > SE401_MAX_ERRORS) { | 882 | if (errors > SE401_MAX_ERRORS) { |
882 | errors=0; | 883 | errors=0; |
883 | info("to much errors, restarting capture"); | 884 | dev_info(&se401->dev->dev, |
885 | "too many errors, restarting capture\n"); | ||
884 | se401_stop_stream(se401); | 886 | se401_stop_stream(se401); |
885 | se401_start_stream(se401); | 887 | se401_start_stream(se401); |
886 | } | 888 | } |
@@ -913,7 +915,7 @@ static void usb_se401_remove_disconnected (struct usb_se401 *se401) | |||
913 | usb_kill_urb(se401->inturb); | 915 | usb_kill_urb(se401->inturb); |
914 | usb_free_urb(se401->inturb); | 916 | usb_free_urb(se401->inturb); |
915 | } | 917 | } |
916 | info("%s disconnected", se401->camera_name); | 918 | dev_info(&se401->dev->dev, "%s disconnected", se401->camera_name); |
917 | 919 | ||
918 | /* Free the memory */ | 920 | /* Free the memory */ |
919 | kfree(se401->width); | 921 | kfree(se401->width); |
@@ -936,14 +938,18 @@ static int se401_open(struct inode *inode, struct file *file) | |||
936 | struct usb_se401 *se401 = (struct usb_se401 *)dev; | 938 | struct usb_se401 *se401 = (struct usb_se401 *)dev; |
937 | int err = 0; | 939 | int err = 0; |
938 | 940 | ||
939 | if (se401->user) | 941 | lock_kernel(); |
942 | if (se401->user) { | ||
943 | unlock_kernel(); | ||
940 | return -EBUSY; | 944 | return -EBUSY; |
945 | } | ||
941 | se401->fbuf = rvmalloc(se401->maxframesize * SE401_NUMFRAMES); | 946 | se401->fbuf = rvmalloc(se401->maxframesize * SE401_NUMFRAMES); |
942 | if (se401->fbuf) | 947 | if (se401->fbuf) |
943 | file->private_data = dev; | 948 | file->private_data = dev; |
944 | else | 949 | else |
945 | err = -ENOMEM; | 950 | err = -ENOMEM; |
946 | se401->user = !err; | 951 | se401->user = !err; |
952 | unlock_kernel(); | ||
947 | 953 | ||
948 | return err; | 954 | return err; |
949 | } | 955 | } |
@@ -956,8 +962,8 @@ static int se401_close(struct inode *inode, struct file *file) | |||
956 | 962 | ||
957 | rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES); | 963 | rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES); |
958 | if (se401->removed) { | 964 | if (se401->removed) { |
965 | dev_info(&se401->dev->dev, "device unregistered\n"); | ||
959 | usb_se401_remove_disconnected(se401); | 966 | usb_se401_remove_disconnected(se401); |
960 | info("device unregistered"); | ||
961 | } else { | 967 | } else { |
962 | for (i=0; i<SE401_NUMFRAMES; i++) | 968 | for (i=0; i<SE401_NUMFRAMES; i++) |
963 | se401->frame[i].grabstate=FRAME_UNUSED; | 969 | se401->frame[i].grabstate=FRAME_UNUSED; |
@@ -1232,6 +1238,7 @@ static const struct file_operations se401_fops = { | |||
1232 | static struct video_device se401_template = { | 1238 | static struct video_device se401_template = { |
1233 | .name = "se401 USB camera", | 1239 | .name = "se401 USB camera", |
1234 | .fops = &se401_fops, | 1240 | .fops = &se401_fops, |
1241 | .release = video_device_release_empty, | ||
1235 | }; | 1242 | }; |
1236 | 1243 | ||
1237 | 1244 | ||
@@ -1271,7 +1278,7 @@ static int se401_init(struct usb_se401 *se401, int button) | |||
1271 | for (i=0; i<se401->sizes; i++) { | 1278 | for (i=0; i<se401->sizes; i++) { |
1272 | sprintf(temp, "%s %dx%d", temp, se401->width[i], se401->height[i]); | 1279 | sprintf(temp, "%s %dx%d", temp, se401->width[i], se401->height[i]); |
1273 | } | 1280 | } |
1274 | info("%s", temp); | 1281 | dev_info(&se401->dev->dev, "%s\n", temp); |
1275 | se401->maxframesize=se401->width[se401->sizes-1]*se401->height[se401->sizes-1]*3; | 1282 | se401->maxframesize=se401->width[se401->sizes-1]*se401->height[se401->sizes-1]*3; |
1276 | 1283 | ||
1277 | rc=se401_sndctrl(0, se401, SE401_REQ_GET_WIDTH, 0, cp, sizeof(cp)); | 1284 | rc=se401_sndctrl(0, se401, SE401_REQ_GET_WIDTH, 0, cp, sizeof(cp)); |
@@ -1305,7 +1312,8 @@ static int se401_init(struct usb_se401 *se401, int button) | |||
1305 | if (button) { | 1312 | if (button) { |
1306 | se401->inturb=usb_alloc_urb(0, GFP_KERNEL); | 1313 | se401->inturb=usb_alloc_urb(0, GFP_KERNEL); |
1307 | if (!se401->inturb) { | 1314 | if (!se401->inturb) { |
1308 | info("Allocation of inturb failed"); | 1315 | dev_info(&se401->dev->dev, |
1316 | "Allocation of inturb failed\n"); | ||
1309 | return 1; | 1317 | return 1; |
1310 | } | 1318 | } |
1311 | usb_fill_int_urb(se401->inturb, se401->dev, | 1319 | usb_fill_int_urb(se401->inturb, se401->dev, |
@@ -1316,7 +1324,7 @@ static int se401_init(struct usb_se401 *se401, int button) | |||
1316 | 8 | 1324 | 8 |
1317 | ); | 1325 | ); |
1318 | if (usb_submit_urb(se401->inturb, GFP_KERNEL)) { | 1326 | if (usb_submit_urb(se401->inturb, GFP_KERNEL)) { |
1319 | info("int urb burned down"); | 1327 | dev_info(&se401->dev->dev, "int urb burned down\n"); |
1320 | return 1; | 1328 | return 1; |
1321 | } | 1329 | } |
1322 | } else | 1330 | } else |
@@ -1373,7 +1381,7 @@ static int se401_probe(struct usb_interface *intf, | |||
1373 | return -ENODEV; | 1381 | return -ENODEV; |
1374 | 1382 | ||
1375 | /* We found one */ | 1383 | /* We found one */ |
1376 | info("SE401 camera found: %s", camera_name); | 1384 | dev_info(&intf->dev, "SE401 camera found: %s\n", camera_name); |
1377 | 1385 | ||
1378 | if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { | 1386 | if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { |
1379 | err("couldn't kmalloc se401 struct"); | 1387 | err("couldn't kmalloc se401 struct"); |
@@ -1384,7 +1392,8 @@ static int se401_probe(struct usb_interface *intf, | |||
1384 | se401->iface = interface->bInterfaceNumber; | 1392 | se401->iface = interface->bInterfaceNumber; |
1385 | se401->camera_name = camera_name; | 1393 | se401->camera_name = camera_name; |
1386 | 1394 | ||
1387 | info("firmware version: %02x", le16_to_cpu(dev->descriptor.bcdDevice) & 255); | 1395 | dev_info(&intf->dev, "firmware version: %02x\n", |
1396 | le16_to_cpu(dev->descriptor.bcdDevice) & 255); | ||
1388 | 1397 | ||
1389 | if (se401_init(se401, button)) { | 1398 | if (se401_init(se401, button)) { |
1390 | kfree(se401); | 1399 | kfree(se401); |
@@ -1402,7 +1411,8 @@ static int se401_probe(struct usb_interface *intf, | |||
1402 | err("video_register_device failed"); | 1411 | err("video_register_device failed"); |
1403 | return -EIO; | 1412 | return -EIO; |
1404 | } | 1413 | } |
1405 | info("registered new video device: video%d", se401->vdev.minor); | 1414 | dev_info(&intf->dev, "registered new video device: video%d\n", |
1415 | se401->vdev.minor); | ||
1406 | 1416 | ||
1407 | usb_set_intfdata (intf, se401); | 1417 | usb_set_intfdata (intf, se401); |
1408 | return 0; | 1418 | return 0; |
@@ -1446,10 +1456,10 @@ static struct usb_driver se401_driver = { | |||
1446 | 1456 | ||
1447 | static int __init usb_se401_init(void) | 1457 | static int __init usb_se401_init(void) |
1448 | { | 1458 | { |
1449 | info("SE401 usb camera driver version %s registering", version); | 1459 | printk(KERN_INFO "SE401 usb camera driver version %s registering\n", version); |
1450 | if (flickerless) | 1460 | if (flickerless) |
1451 | if (flickerless!=50 && flickerless!=60) { | 1461 | if (flickerless!=50 && flickerless!=60) { |
1452 | info("Invallid flickerless value, use 0, 50 or 60."); | 1462 | printk(KERN_ERR "Invallid flickerless value, use 0, 50 or 60.\n"); |
1453 | return -1; | 1463 | return -1; |
1454 | } | 1464 | } |
1455 | return usb_register(&se401_driver); | 1465 | return usb_register(&se401_driver); |
@@ -1458,7 +1468,7 @@ static int __init usb_se401_init(void) | |||
1458 | static void __exit usb_se401_exit(void) | 1468 | static void __exit usb_se401_exit(void) |
1459 | { | 1469 | { |
1460 | usb_deregister(&se401_driver); | 1470 | usb_deregister(&se401_driver); |
1461 | info("SE401 driver deregistered"); | 1471 | printk(KERN_INFO "SE401 driver deregistered\frame"); |
1462 | } | 1472 | } |
1463 | 1473 | ||
1464 | module_init(usb_se401_init); | 1474 | module_init(usb_se401_init); |