aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/stv680.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/stv680.c')
-rw-r--r--drivers/media/video/stv680.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index d7f130bedb5f..56dc3d6b5b29 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -66,6 +66,7 @@
66#include <linux/errno.h> 66#include <linux/errno.h>
67#include <linux/videodev.h> 67#include <linux/videodev.h>
68#include <media/v4l2-common.h> 68#include <media/v4l2-common.h>
69#include <media/v4l2-ioctl.h>
69#include <linux/usb.h> 70#include <linux/usb.h>
70#include <linux/mutex.h> 71#include <linux/mutex.h>
71 72
@@ -524,53 +525,54 @@ static int stv680_create_sysfs_files(struct video_device *vdev)
524{ 525{
525 int rc; 526 int rc;
526 527
527 rc = video_device_create_file(vdev, &dev_attr_model); 528 rc = device_create_file(&vdev->dev, &dev_attr_model);
528 if (rc) goto err; 529 if (rc) goto err;
529 rc = video_device_create_file(vdev, &dev_attr_in_use); 530 rc = device_create_file(&vdev->dev, &dev_attr_in_use);
530 if (rc) goto err_model; 531 if (rc) goto err_model;
531 rc = video_device_create_file(vdev, &dev_attr_streaming); 532 rc = device_create_file(&vdev->dev, &dev_attr_streaming);
532 if (rc) goto err_inuse; 533 if (rc) goto err_inuse;
533 rc = video_device_create_file(vdev, &dev_attr_palette); 534 rc = device_create_file(&vdev->dev, &dev_attr_palette);
534 if (rc) goto err_stream; 535 if (rc) goto err_stream;
535 rc = video_device_create_file(vdev, &dev_attr_frames_total); 536 rc = device_create_file(&vdev->dev, &dev_attr_frames_total);
536 if (rc) goto err_pal; 537 if (rc) goto err_pal;
537 rc = video_device_create_file(vdev, &dev_attr_frames_read); 538 rc = device_create_file(&vdev->dev, &dev_attr_frames_read);
538 if (rc) goto err_framtot; 539 if (rc) goto err_framtot;
539 rc = video_device_create_file(vdev, &dev_attr_packets_dropped); 540 rc = device_create_file(&vdev->dev, &dev_attr_packets_dropped);
540 if (rc) goto err_framread; 541 if (rc) goto err_framread;
541 rc = video_device_create_file(vdev, &dev_attr_decoding_errors); 542 rc = device_create_file(&vdev->dev, &dev_attr_decoding_errors);
542 if (rc) goto err_dropped; 543 if (rc) goto err_dropped;
543 544
544 return 0; 545 return 0;
545 546
546err_dropped: 547err_dropped:
547 video_device_remove_file(vdev, &dev_attr_packets_dropped); 548 device_remove_file(&vdev->dev, &dev_attr_packets_dropped);
548err_framread: 549err_framread:
549 video_device_remove_file(vdev, &dev_attr_frames_read); 550 device_remove_file(&vdev->dev, &dev_attr_frames_read);
550err_framtot: 551err_framtot:
551 video_device_remove_file(vdev, &dev_attr_frames_total); 552 device_remove_file(&vdev->dev, &dev_attr_frames_total);
552err_pal: 553err_pal:
553 video_device_remove_file(vdev, &dev_attr_palette); 554 device_remove_file(&vdev->dev, &dev_attr_palette);
554err_stream: 555err_stream:
555 video_device_remove_file(vdev, &dev_attr_streaming); 556 device_remove_file(&vdev->dev, &dev_attr_streaming);
556err_inuse: 557err_inuse:
557 video_device_remove_file(vdev, &dev_attr_in_use); 558 device_remove_file(&vdev->dev, &dev_attr_in_use);
558err_model: 559err_model:
559 video_device_remove_file(vdev, &dev_attr_model); 560 device_remove_file(&vdev->dev, &dev_attr_model);
560err: 561err:
562 PDEBUG(0, "STV(e): Could not create sysfs files");
561 return rc; 563 return rc;
562} 564}
563 565
564static void stv680_remove_sysfs_files(struct video_device *vdev) 566static void stv680_remove_sysfs_files(struct video_device *vdev)
565{ 567{
566 video_device_remove_file(vdev, &dev_attr_model); 568 device_remove_file(&vdev->dev, &dev_attr_model);
567 video_device_remove_file(vdev, &dev_attr_in_use); 569 device_remove_file(&vdev->dev, &dev_attr_in_use);
568 video_device_remove_file(vdev, &dev_attr_streaming); 570 device_remove_file(&vdev->dev, &dev_attr_streaming);
569 video_device_remove_file(vdev, &dev_attr_palette); 571 device_remove_file(&vdev->dev, &dev_attr_palette);
570 video_device_remove_file(vdev, &dev_attr_frames_total); 572 device_remove_file(&vdev->dev, &dev_attr_frames_total);
571 video_device_remove_file(vdev, &dev_attr_frames_read); 573 device_remove_file(&vdev->dev, &dev_attr_frames_read);
572 video_device_remove_file(vdev, &dev_attr_packets_dropped); 574 device_remove_file(&vdev->dev, &dev_attr_packets_dropped);
573 video_device_remove_file(vdev, &dev_attr_decoding_errors); 575 device_remove_file(&vdev->dev, &dev_attr_decoding_errors);
574} 576}
575 577
576/******************************************************************** 578/********************************************************************
@@ -1400,9 +1402,7 @@ static const struct file_operations stv680_fops = {
1400 .llseek = no_llseek, 1402 .llseek = no_llseek,
1401}; 1403};
1402static struct video_device stv680_template = { 1404static struct video_device stv680_template = {
1403 .owner = THIS_MODULE,
1404 .name = "STV0680 USB camera", 1405 .name = "STV0680 USB camera",
1405 .type = VID_TYPE_CAPTURE,
1406 .fops = &stv680_fops, 1406 .fops = &stv680_fops,
1407 .release = video_device_release, 1407 .release = video_device_release,
1408 .minor = -1, 1408 .minor = -1,
@@ -1454,7 +1454,7 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
1454 goto error; 1454 goto error;
1455 } 1455 }
1456 memcpy(stv680->vdev, &stv680_template, sizeof(stv680_template)); 1456 memcpy(stv680->vdev, &stv680_template, sizeof(stv680_template));
1457 stv680->vdev->dev = &intf->dev; 1457 stv680->vdev->parent = &intf->dev;
1458 video_set_drvdata(stv680->vdev, stv680); 1458 video_set_drvdata(stv680->vdev, stv680);
1459 1459
1460 memcpy (stv680->vdev->name, stv680->camera_name, strlen (stv680->camera_name)); 1460 memcpy (stv680->vdev->name, stv680->camera_name, strlen (stv680->camera_name));