aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/et61x251
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-10-08 15:26:13 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 23:03:14 -0400
commit54bd5b66c87d14e250f108aad1228b905d6882f6 (patch)
tree2ecb78046819e2c9da176a74e4e9fbc8097031be /drivers/media/video/et61x251
parentd4cae5a50021271b9ef4e5e39e71e177d12fa8cb (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/et61x251')
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c58
1 files changed, 32 insertions, 26 deletions
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index 31062a981e36..d5fef4c01c87 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -706,7 +706,8 @@ static u8 et61x251_strtou8(const char* buff, size_t len, ssize_t* count)
706 NOTE 2: buffers are PAGE_SIZE long 706 NOTE 2: buffers are PAGE_SIZE long
707*/ 707*/
708 708
709static ssize_t et61x251_show_reg(struct class_device* cd, char* buf) 709static ssize_t et61x251_show_reg(struct device* cd,
710 struct device_attribute *attr, char* buf)
710{ 711{
711 struct et61x251_device* cam; 712 struct et61x251_device* cam;
712 ssize_t count; 713 ssize_t count;
@@ -729,7 +730,8 @@ static ssize_t et61x251_show_reg(struct class_device* cd, char* buf)
729 730
730 731
731static ssize_t 732static ssize_t
732et61x251_store_reg(struct class_device* cd, const char* buf, size_t len) 733et61x251_store_reg(struct device* cd,
734 struct device_attribute *attr, const char* buf, size_t len)
733{ 735{
734 struct et61x251_device* cam; 736 struct et61x251_device* cam;
735 u8 index; 737 u8 index;
@@ -761,7 +763,8 @@ et61x251_store_reg(struct class_device* cd, const char* buf, size_t len)
761} 763}
762 764
763 765
764static ssize_t et61x251_show_val(struct class_device* cd, char* buf) 766static ssize_t et61x251_show_val(struct device* cd,
767 struct device_attribute *attr, char* buf)
765{ 768{
766 struct et61x251_device* cam; 769 struct et61x251_device* cam;
767 ssize_t count; 770 ssize_t count;
@@ -792,7 +795,8 @@ static ssize_t et61x251_show_val(struct class_device* cd, char* buf)
792 795
793 796
794static ssize_t 797static ssize_t
795et61x251_store_val(struct class_device* cd, const char* buf, size_t len) 798et61x251_store_val(struct device* cd, struct device_attribute *attr,
799 const char* buf, size_t len)
796{ 800{
797 struct et61x251_device* cam; 801 struct et61x251_device* cam;
798 u8 value; 802 u8 value;
@@ -830,7 +834,8 @@ et61x251_store_val(struct class_device* cd, const char* buf, size_t len)
830} 834}
831 835
832 836
833static ssize_t et61x251_show_i2c_reg(struct class_device* cd, char* buf) 837static ssize_t et61x251_show_i2c_reg(struct device* cd,
838 struct device_attribute *attr, char* buf)
834{ 839{
835 struct et61x251_device* cam; 840 struct et61x251_device* cam;
836 ssize_t count; 841 ssize_t count;
@@ -855,7 +860,8 @@ static ssize_t et61x251_show_i2c_reg(struct class_device* cd, char* buf)
855 860
856 861
857static ssize_t 862static ssize_t
858et61x251_store_i2c_reg(struct class_device* cd, const char* buf, size_t len) 863et61x251_store_i2c_reg(struct device* cd, struct device_attribute *attr,
864 const char* buf, size_t len)
859{ 865{
860 struct et61x251_device* cam; 866 struct et61x251_device* cam;
861 u8 index; 867 u8 index;
@@ -887,7 +893,8 @@ et61x251_store_i2c_reg(struct class_device* cd, const char* buf, size_t len)
887} 893}
888 894
889 895
890static ssize_t et61x251_show_i2c_val(struct class_device* cd, char* buf) 896static ssize_t et61x251_show_i2c_val(struct device* cd,
897 struct device_attribute *attr, char* buf)
891{ 898{
892 struct et61x251_device* cam; 899 struct et61x251_device* cam;
893 ssize_t count; 900 ssize_t count;
@@ -923,7 +930,8 @@ static ssize_t et61x251_show_i2c_val(struct class_device* cd, char* buf)
923 930
924 931
925static ssize_t 932static ssize_t
926et61x251_store_i2c_val(struct class_device* cd, const char* buf, size_t len) 933et61x251_store_i2c_val(struct device* cd, struct device_attribute *attr,
934 const char* buf, size_t len)
927{ 935{
928 struct et61x251_device* cam; 936 struct et61x251_device* cam;
929 u8 value; 937 u8 value;
@@ -966,42 +974,40 @@ et61x251_store_i2c_val(struct class_device* cd, const char* buf, size_t len)
966} 974}
967 975
968 976
969static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR, 977static DEVICE_ATTR(reg, S_IRUGO | S_IWUSR,
970 et61x251_show_reg, et61x251_store_reg); 978 et61x251_show_reg, et61x251_store_reg);
971static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR, 979static DEVICE_ATTR(val, S_IRUGO | S_IWUSR,
972 et61x251_show_val, et61x251_store_val); 980 et61x251_show_val, et61x251_store_val);
973static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, 981static DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR,
974 et61x251_show_i2c_reg, et61x251_store_i2c_reg); 982 et61x251_show_i2c_reg, et61x251_store_i2c_reg);
975static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, 983static DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR,
976 et61x251_show_i2c_val, et61x251_store_i2c_val); 984 et61x251_show_i2c_val, et61x251_store_i2c_val);
977 985
978 986
979static int et61x251_create_sysfs(struct et61x251_device* cam) 987static int et61x251_create_sysfs(struct et61x251_device* cam)
980{ 988{
981 struct class_device *classdev = &(cam->v4ldev->class_dev); 989 struct device *classdev = &(cam->v4ldev->class_dev);
982 int err = 0; 990 int err = 0;
983 991
984 if ((err = class_device_create_file(classdev, &class_device_attr_reg))) 992 if ((err = device_create_file(classdev, &dev_attr_reg)))
985 goto err_out; 993 goto err_out;
986 if ((err = class_device_create_file(classdev, &class_device_attr_val))) 994 if ((err = device_create_file(classdev, &dev_attr_val)))
987 goto err_reg; 995 goto err_reg;
988 996
989 if (cam->sensor.sysfs_ops) { 997 if (cam->sensor.sysfs_ops) {
990 if ((err = class_device_create_file(classdev, 998 if ((err = device_create_file(classdev, &dev_attr_i2c_reg)))
991 &class_device_attr_i2c_reg)))
992 goto err_val; 999 goto err_val;
993 if ((err = class_device_create_file(classdev, 1000 if ((err = device_create_file(classdev, &dev_attr_i2c_val)))
994 &class_device_attr_i2c_val)))
995 goto err_i2c_reg; 1001 goto err_i2c_reg;
996 } 1002 }
997 1003
998err_i2c_reg: 1004err_i2c_reg:
999 if (cam->sensor.sysfs_ops) 1005 if (cam->sensor.sysfs_ops)
1000 class_device_remove_file(classdev, &class_device_attr_i2c_reg); 1006 device_remove_file(classdev, &dev_attr_i2c_reg);
1001err_val: 1007err_val:
1002 class_device_remove_file(classdev, &class_device_attr_val); 1008 device_remove_file(classdev, &dev_attr_val);
1003err_reg: 1009err_reg:
1004 class_device_remove_file(classdev, &class_device_attr_reg); 1010 device_remove_file(classdev, &dev_attr_reg);
1005err_out: 1011err_out:
1006 return err; 1012 return err;
1007} 1013}