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/et61x251 | |
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/et61x251')
-rw-r--r-- | drivers/media/video/et61x251/et61x251_core.c | 58 |
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 | ||
709 | static ssize_t et61x251_show_reg(struct class_device* cd, char* buf) | 709 | static 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 | ||
731 | static ssize_t | 732 | static ssize_t |
732 | et61x251_store_reg(struct class_device* cd, const char* buf, size_t len) | 733 | et61x251_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 | ||
764 | static ssize_t et61x251_show_val(struct class_device* cd, char* buf) | 766 | static 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 | ||
794 | static ssize_t | 797 | static ssize_t |
795 | et61x251_store_val(struct class_device* cd, const char* buf, size_t len) | 798 | et61x251_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 | ||
833 | static ssize_t et61x251_show_i2c_reg(struct class_device* cd, char* buf) | 837 | static 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 | ||
857 | static ssize_t | 862 | static ssize_t |
858 | et61x251_store_i2c_reg(struct class_device* cd, const char* buf, size_t len) | 863 | et61x251_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 | ||
890 | static ssize_t et61x251_show_i2c_val(struct class_device* cd, char* buf) | 896 | static 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 | ||
925 | static ssize_t | 932 | static ssize_t |
926 | et61x251_store_i2c_val(struct class_device* cd, const char* buf, size_t len) | 933 | et61x251_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 | ||
969 | static CLASS_DEVICE_ATTR(reg, S_IRUGO | S_IWUSR, | 977 | static DEVICE_ATTR(reg, S_IRUGO | S_IWUSR, |
970 | et61x251_show_reg, et61x251_store_reg); | 978 | et61x251_show_reg, et61x251_store_reg); |
971 | static CLASS_DEVICE_ATTR(val, S_IRUGO | S_IWUSR, | 979 | static DEVICE_ATTR(val, S_IRUGO | S_IWUSR, |
972 | et61x251_show_val, et61x251_store_val); | 980 | et61x251_show_val, et61x251_store_val); |
973 | static CLASS_DEVICE_ATTR(i2c_reg, S_IRUGO | S_IWUSR, | 981 | static 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); |
975 | static CLASS_DEVICE_ATTR(i2c_val, S_IRUGO | S_IWUSR, | 983 | static 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 | ||
979 | static int et61x251_create_sysfs(struct et61x251_device* cam) | 987 | static 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 | ||
998 | err_i2c_reg: | 1004 | err_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); |
1001 | err_val: | 1007 | err_val: |
1002 | class_device_remove_file(classdev, &class_device_attr_val); | 1008 | device_remove_file(classdev, &dev_attr_val); |
1003 | err_reg: | 1009 | err_reg: |
1004 | class_device_remove_file(classdev, &class_device_attr_reg); | 1010 | device_remove_file(classdev, &dev_attr_reg); |
1005 | err_out: | 1011 | err_out: |
1006 | return err; | 1012 | return err; |
1007 | } | 1013 | } |