diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-10-08 15:26:13 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 23:03:14 -0400 |
commit | 54bd5b66c87d14e250f108aad1228b905d6882f6 (patch) | |
tree | 2ecb78046819e2c9da176a74e4e9fbc8097031be /drivers/media/video/stv680.c | |
parent | d4cae5a50021271b9ef4e5e39e71e177d12fa8cb (diff) |
V4L/DVB (6293): V4L: convert struct class_device to struct device
The currently used "struct class_device" will be removed from the
kernel. Here is a patch that converts all users in drivers/media/video/
to struct device.
Reviewed-by: Thierry Merle <thierry.merle@free.fr>
Reviewed-by: Mike Isely <isely@pobox.com>
Reviewed-by: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/stv680.c')
-rw-r--r-- | drivers/media/video/stv680.c | 51 |
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) \ |
502 | static ssize_t show_##name(struct class_device *class_dev, char *buf) \ | 502 | static 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 | } \ |
508 | static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); | 509 | static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL); |
509 | 510 | ||
510 | stv680_file(model, camera_name, "%s\n"); | 511 | stv680_file(model, camera_name, "%s\n"); |
511 | stv680_file(in_use, user, "%d\n"); | 512 | stv680_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 | ||
542 | err_dropped: | 543 | err_dropped: |
543 | video_device_remove_file(vdev, &class_device_attr_packets_dropped); | 544 | video_device_remove_file(vdev, &dev_attr_packets_dropped); |
544 | err_framread: | 545 | err_framread: |
545 | video_device_remove_file(vdev, &class_device_attr_frames_read); | 546 | video_device_remove_file(vdev, &dev_attr_frames_read); |
546 | err_framtot: | 547 | err_framtot: |
547 | video_device_remove_file(vdev, &class_device_attr_frames_total); | 548 | video_device_remove_file(vdev, &dev_attr_frames_total); |
548 | err_pal: | 549 | err_pal: |
549 | video_device_remove_file(vdev, &class_device_attr_palette); | 550 | video_device_remove_file(vdev, &dev_attr_palette); |
550 | err_stream: | 551 | err_stream: |
551 | video_device_remove_file(vdev, &class_device_attr_streaming); | 552 | video_device_remove_file(vdev, &dev_attr_streaming); |
552 | err_inuse: | 553 | err_inuse: |
553 | video_device_remove_file(vdev, &class_device_attr_in_use); | 554 | video_device_remove_file(vdev, &dev_attr_in_use); |
554 | err_model: | 555 | err_model: |
555 | video_device_remove_file(vdev, &class_device_attr_model); | 556 | video_device_remove_file(vdev, &dev_attr_model); |
556 | err: | 557 | err: |
557 | return rc; | 558 | return rc; |
558 | } | 559 | } |
559 | 560 | ||
560 | static void stv680_remove_sysfs_files(struct video_device *vdev) | 561 | static 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 | /******************************************************************** |