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.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 4dc5bc714b95..9e009a7ab863 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -499,13 +499,14 @@ exit:
499 * sysfs 499 * sysfs
500 ***************************************************************************/ 500 ***************************************************************************/
501#define stv680_file(name, variable, field) \ 501#define stv680_file(name, variable, field) \
502static ssize_t show_##name(struct class_device *class_dev, char *buf) \ 502static ssize_t show_##name(struct device *class_dev, \
503 struct device_attribute *attr, char *buf) \
503{ \ 504{ \
504 struct video_device *vdev = to_video_device(class_dev); \ 505 struct video_device *vdev = to_video_device(class_dev); \
505 struct usb_stv *stv = video_get_drvdata(vdev); \ 506 struct usb_stv *stv = video_get_drvdata(vdev); \
506 return sprintf(buf, field, stv->variable); \ 507 return sprintf(buf, field, stv->variable); \
507} \ 508} \
508static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); 509static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL);
509 510
510stv680_file(model, camera_name, "%s\n"); 511stv680_file(model, camera_name, "%s\n");
511stv680_file(in_use, user, "%d\n"); 512stv680_file(in_use, user, "%d\n");
@@ -520,53 +521,53 @@ static int stv680_create_sysfs_files(struct video_device *vdev)
520{ 521{
521 int rc; 522 int rc;
522 523
523 rc = video_device_create_file(vdev, &class_device_attr_model); 524 rc = video_device_create_file(vdev, &dev_attr_model);
524 if (rc) goto err; 525 if (rc) goto err;
525 rc = video_device_create_file(vdev, &class_device_attr_in_use); 526 rc = video_device_create_file(vdev, &dev_attr_in_use);
526 if (rc) goto err_model; 527 if (rc) goto err_model;
527 rc = video_device_create_file(vdev, &class_device_attr_streaming); 528 rc = video_device_create_file(vdev, &dev_attr_streaming);
528 if (rc) goto err_inuse; 529 if (rc) goto err_inuse;
529 rc = video_device_create_file(vdev, &class_device_attr_palette); 530 rc = video_device_create_file(vdev, &dev_attr_palette);
530 if (rc) goto err_stream; 531 if (rc) goto err_stream;
531 rc = video_device_create_file(vdev, &class_device_attr_frames_total); 532 rc = video_device_create_file(vdev, &dev_attr_frames_total);
532 if (rc) goto err_pal; 533 if (rc) goto err_pal;
533 rc = video_device_create_file(vdev, &class_device_attr_frames_read); 534 rc = video_device_create_file(vdev, &dev_attr_frames_read);
534 if (rc) goto err_framtot; 535 if (rc) goto err_framtot;
535 rc = video_device_create_file(vdev, &class_device_attr_packets_dropped); 536 rc = video_device_create_file(vdev, &dev_attr_packets_dropped);
536 if (rc) goto err_framread; 537 if (rc) goto err_framread;
537 rc = video_device_create_file(vdev, &class_device_attr_decoding_errors); 538 rc = video_device_create_file(vdev, &dev_attr_decoding_errors);
538 if (rc) goto err_dropped; 539 if (rc) goto err_dropped;
539 540
540 return 0; 541 return 0;
541 542
542err_dropped: 543err_dropped:
543 video_device_remove_file(vdev, &class_device_attr_packets_dropped); 544 video_device_remove_file(vdev, &dev_attr_packets_dropped);
544err_framread: 545err_framread:
545 video_device_remove_file(vdev, &class_device_attr_frames_read); 546 video_device_remove_file(vdev, &dev_attr_frames_read);
546err_framtot: 547err_framtot:
547 video_device_remove_file(vdev, &class_device_attr_frames_total); 548 video_device_remove_file(vdev, &dev_attr_frames_total);
548err_pal: 549err_pal:
549 video_device_remove_file(vdev, &class_device_attr_palette); 550 video_device_remove_file(vdev, &dev_attr_palette);
550err_stream: 551err_stream:
551 video_device_remove_file(vdev, &class_device_attr_streaming); 552 video_device_remove_file(vdev, &dev_attr_streaming);
552err_inuse: 553err_inuse:
553 video_device_remove_file(vdev, &class_device_attr_in_use); 554 video_device_remove_file(vdev, &dev_attr_in_use);
554err_model: 555err_model:
555 video_device_remove_file(vdev, &class_device_attr_model); 556 video_device_remove_file(vdev, &dev_attr_model);
556err: 557err:
557 return rc; 558 return rc;
558} 559}
559 560
560static void stv680_remove_sysfs_files(struct video_device *vdev) 561static void stv680_remove_sysfs_files(struct video_device *vdev)
561{ 562{
562 video_device_remove_file(vdev, &class_device_attr_model); 563 video_device_remove_file(vdev, &dev_attr_model);
563 video_device_remove_file(vdev, &class_device_attr_in_use); 564 video_device_remove_file(vdev, &dev_attr_in_use);
564 video_device_remove_file(vdev, &class_device_attr_streaming); 565 video_device_remove_file(vdev, &dev_attr_streaming);
565 video_device_remove_file(vdev, &class_device_attr_palette); 566 video_device_remove_file(vdev, &dev_attr_palette);
566 video_device_remove_file(vdev, &class_device_attr_frames_total); 567 video_device_remove_file(vdev, &dev_attr_frames_total);
567 video_device_remove_file(vdev, &class_device_attr_frames_read); 568 video_device_remove_file(vdev, &dev_attr_frames_read);
568 video_device_remove_file(vdev, &class_device_attr_packets_dropped); 569 video_device_remove_file(vdev, &dev_attr_packets_dropped);
569 video_device_remove_file(vdev, &class_device_attr_decoding_errors); 570 video_device_remove_file(vdev, &dev_attr_decoding_errors);
570} 571}
571 572
572/******************************************************************** 573/********************************************************************