diff options
author | Len Brown <len.brown@intel.com> | 2006-12-16 01:04:27 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-16 01:04:27 -0500 |
commit | cece901481bafbf14de8cbd3a89ae869ea881055 (patch) | |
tree | f9e240443643008c8feeaf55919105dc63ab8c72 /drivers/acpi/video.c | |
parent | cfee47f99bc14a6d7c6b0be2284db2cef310a815 (diff) | |
parent | 50dd096973f1d95aa03c6a6d9e148d706b62b68e (diff) |
Pull style into test branch
Conflicts:
drivers/acpi/button.c
drivers/acpi/ec.c
drivers/acpi/osl.c
drivers/acpi/sbs.c
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 56666a982476..53a9eb015d6b 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -386,7 +386,7 @@ acpi_video_device_EDID(struct acpi_video_device *device, | |||
386 | if (ACPI_FAILURE(status)) | 386 | if (ACPI_FAILURE(status)) |
387 | return -ENODEV; | 387 | return -ENODEV; |
388 | 388 | ||
389 | obj = (union acpi_object *)buffer.pointer; | 389 | obj = buffer.pointer; |
390 | 390 | ||
391 | if (obj && obj->type == ACPI_TYPE_BUFFER) | 391 | if (obj && obj->type == ACPI_TYPE_BUFFER) |
392 | *edid = obj; | 392 | *edid = obj; |
@@ -654,8 +654,7 @@ static struct proc_dir_entry *acpi_video_dir; | |||
654 | 654 | ||
655 | static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) | 655 | static int acpi_video_device_info_seq_show(struct seq_file *seq, void *offset) |
656 | { | 656 | { |
657 | struct acpi_video_device *dev = | 657 | struct acpi_video_device *dev = seq->private; |
658 | (struct acpi_video_device *)seq->private; | ||
659 | 658 | ||
660 | 659 | ||
661 | if (!dev) | 660 | if (!dev) |
@@ -688,8 +687,7 @@ acpi_video_device_info_open_fs(struct inode *inode, struct file *file) | |||
688 | static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) | 687 | static int acpi_video_device_state_seq_show(struct seq_file *seq, void *offset) |
689 | { | 688 | { |
690 | int status; | 689 | int status; |
691 | struct acpi_video_device *dev = | 690 | struct acpi_video_device *dev = seq->private; |
692 | (struct acpi_video_device *)seq->private; | ||
693 | unsigned long state; | 691 | unsigned long state; |
694 | 692 | ||
695 | 693 | ||
@@ -727,8 +725,8 @@ acpi_video_device_write_state(struct file *file, | |||
727 | size_t count, loff_t * data) | 725 | size_t count, loff_t * data) |
728 | { | 726 | { |
729 | int status; | 727 | int status; |
730 | struct seq_file *m = (struct seq_file *)file->private_data; | 728 | struct seq_file *m = file->private_data; |
731 | struct acpi_video_device *dev = (struct acpi_video_device *)m->private; | 729 | struct acpi_video_device *dev = m->private; |
732 | char str[12] = { 0 }; | 730 | char str[12] = { 0 }; |
733 | u32 state = 0; | 731 | u32 state = 0; |
734 | 732 | ||
@@ -754,8 +752,7 @@ acpi_video_device_write_state(struct file *file, | |||
754 | static int | 752 | static int |
755 | acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) | 753 | acpi_video_device_brightness_seq_show(struct seq_file *seq, void *offset) |
756 | { | 754 | { |
757 | struct acpi_video_device *dev = | 755 | struct acpi_video_device *dev = seq->private; |
758 | (struct acpi_video_device *)seq->private; | ||
759 | int i; | 756 | int i; |
760 | 757 | ||
761 | 758 | ||
@@ -784,8 +781,8 @@ acpi_video_device_write_brightness(struct file *file, | |||
784 | const char __user * buffer, | 781 | const char __user * buffer, |
785 | size_t count, loff_t * data) | 782 | size_t count, loff_t * data) |
786 | { | 783 | { |
787 | struct seq_file *m = (struct seq_file *)file->private_data; | 784 | struct seq_file *m = file->private_data; |
788 | struct acpi_video_device *dev = (struct acpi_video_device *)m->private; | 785 | struct acpi_video_device *dev = m->private; |
789 | char str[4] = { 0 }; | 786 | char str[4] = { 0 }; |
790 | unsigned int level = 0; | 787 | unsigned int level = 0; |
791 | int i; | 788 | int i; |
@@ -817,8 +814,7 @@ acpi_video_device_write_brightness(struct file *file, | |||
817 | 814 | ||
818 | static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) | 815 | static int acpi_video_device_EDID_seq_show(struct seq_file *seq, void *offset) |
819 | { | 816 | { |
820 | struct acpi_video_device *dev = | 817 | struct acpi_video_device *dev = seq->private; |
821 | (struct acpi_video_device *)seq->private; | ||
822 | int status; | 818 | int status; |
823 | int i; | 819 | int i; |
824 | union acpi_object *edid = NULL; | 820 | union acpi_object *edid = NULL; |
@@ -866,7 +862,7 @@ static int acpi_video_device_add_fs(struct acpi_device *device) | |||
866 | if (!device) | 862 | if (!device) |
867 | return -ENODEV; | 863 | return -ENODEV; |
868 | 864 | ||
869 | vid_dev = (struct acpi_video_device *)acpi_driver_data(device); | 865 | vid_dev = acpi_driver_data(device); |
870 | if (!vid_dev) | 866 | if (!vid_dev) |
871 | return -ENODEV; | 867 | return -ENODEV; |
872 | 868 | ||
@@ -931,7 +927,7 @@ static int acpi_video_device_remove_fs(struct acpi_device *device) | |||
931 | { | 927 | { |
932 | struct acpi_video_device *vid_dev; | 928 | struct acpi_video_device *vid_dev; |
933 | 929 | ||
934 | vid_dev = (struct acpi_video_device *)acpi_driver_data(device); | 930 | vid_dev = acpi_driver_data(device); |
935 | if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) | 931 | if (!vid_dev || !vid_dev->video || !vid_dev->video->dir) |
936 | return -ENODEV; | 932 | return -ENODEV; |
937 | 933 | ||
@@ -950,7 +946,7 @@ static int acpi_video_device_remove_fs(struct acpi_device *device) | |||
950 | /* video bus */ | 946 | /* video bus */ |
951 | static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) | 947 | static int acpi_video_bus_info_seq_show(struct seq_file *seq, void *offset) |
952 | { | 948 | { |
953 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 949 | struct acpi_video_bus *video = seq->private; |
954 | 950 | ||
955 | 951 | ||
956 | if (!video) | 952 | if (!video) |
@@ -975,7 +971,7 @@ static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file) | |||
975 | 971 | ||
976 | static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) | 972 | static int acpi_video_bus_ROM_seq_show(struct seq_file *seq, void *offset) |
977 | { | 973 | { |
978 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 974 | struct acpi_video_bus *video = seq->private; |
979 | 975 | ||
980 | 976 | ||
981 | if (!video) | 977 | if (!video) |
@@ -995,7 +991,7 @@ static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file) | |||
995 | 991 | ||
996 | static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) | 992 | static int acpi_video_bus_POST_info_seq_show(struct seq_file *seq, void *offset) |
997 | { | 993 | { |
998 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 994 | struct acpi_video_bus *video = seq->private; |
999 | unsigned long options; | 995 | unsigned long options; |
1000 | int status; | 996 | int status; |
1001 | 997 | ||
@@ -1033,7 +1029,7 @@ acpi_video_bus_POST_info_open_fs(struct inode *inode, struct file *file) | |||
1033 | 1029 | ||
1034 | static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) | 1030 | static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) |
1035 | { | 1031 | { |
1036 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 1032 | struct acpi_video_bus *video = seq->private; |
1037 | int status; | 1033 | int status; |
1038 | unsigned long id; | 1034 | unsigned long id; |
1039 | 1035 | ||
@@ -1054,7 +1050,7 @@ static int acpi_video_bus_POST_seq_show(struct seq_file *seq, void *offset) | |||
1054 | 1050 | ||
1055 | static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) | 1051 | static int acpi_video_bus_DOS_seq_show(struct seq_file *seq, void *offset) |
1056 | { | 1052 | { |
1057 | struct acpi_video_bus *video = (struct acpi_video_bus *)seq->private; | 1053 | struct acpi_video_bus *video = seq->private; |
1058 | 1054 | ||
1059 | 1055 | ||
1060 | seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); | 1056 | seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); |
@@ -1079,8 +1075,8 @@ acpi_video_bus_write_POST(struct file *file, | |||
1079 | size_t count, loff_t * data) | 1075 | size_t count, loff_t * data) |
1080 | { | 1076 | { |
1081 | int status; | 1077 | int status; |
1082 | struct seq_file *m = (struct seq_file *)file->private_data; | 1078 | struct seq_file *m = file->private_data; |
1083 | struct acpi_video_bus *video = (struct acpi_video_bus *)m->private; | 1079 | struct acpi_video_bus *video = m->private; |
1084 | char str[12] = { 0 }; | 1080 | char str[12] = { 0 }; |
1085 | unsigned long opt, options; | 1081 | unsigned long opt, options; |
1086 | 1082 | ||
@@ -1119,8 +1115,8 @@ acpi_video_bus_write_DOS(struct file *file, | |||
1119 | size_t count, loff_t * data) | 1115 | size_t count, loff_t * data) |
1120 | { | 1116 | { |
1121 | int status; | 1117 | int status; |
1122 | struct seq_file *m = (struct seq_file *)file->private_data; | 1118 | struct seq_file *m = file->private_data; |
1123 | struct acpi_video_bus *video = (struct acpi_video_bus *)m->private; | 1119 | struct acpi_video_bus *video = m->private; |
1124 | char str[12] = { 0 }; | 1120 | char str[12] = { 0 }; |
1125 | unsigned long opt; | 1121 | unsigned long opt; |
1126 | 1122 | ||
@@ -1150,7 +1146,7 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1150 | struct acpi_video_bus *video; | 1146 | struct acpi_video_bus *video; |
1151 | 1147 | ||
1152 | 1148 | ||
1153 | video = (struct acpi_video_bus *)acpi_driver_data(device); | 1149 | video = acpi_driver_data(device); |
1154 | 1150 | ||
1155 | if (!acpi_device_dir(device)) { | 1151 | if (!acpi_device_dir(device)) { |
1156 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | 1152 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), |
@@ -1226,7 +1222,7 @@ static int acpi_video_bus_remove_fs(struct acpi_device *device) | |||
1226 | struct acpi_video_bus *video; | 1222 | struct acpi_video_bus *video; |
1227 | 1223 | ||
1228 | 1224 | ||
1229 | video = (struct acpi_video_bus *)acpi_driver_data(device); | 1225 | video = acpi_driver_data(device); |
1230 | 1226 | ||
1231 | if (acpi_device_dir(device)) { | 1227 | if (acpi_device_dir(device)) { |
1232 | remove_proc_entry("info", acpi_device_dir(device)); | 1228 | remove_proc_entry("info", acpi_device_dir(device)); |
@@ -1403,7 +1399,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) | |||
1403 | return status; | 1399 | return status; |
1404 | } | 1400 | } |
1405 | 1401 | ||
1406 | dod = (union acpi_object *)buffer.pointer; | 1402 | dod = buffer.pointer; |
1407 | if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { | 1403 | if (!dod || (dod->type != ACPI_TYPE_PACKAGE)) { |
1408 | ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data")); | 1404 | ACPI_EXCEPTION((AE_INFO, status, "Invalid _DOD data")); |
1409 | status = -EFAULT; | 1405 | status = -EFAULT; |
@@ -1426,7 +1422,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video) | |||
1426 | 1422 | ||
1427 | count = 0; | 1423 | count = 0; |
1428 | for (i = 0; i < dod->package.count; i++) { | 1424 | for (i = 0; i < dod->package.count; i++) { |
1429 | obj = (union acpi_object *)&dod->package.elements[i]; | 1425 | obj = &dod->package.elements[i]; |
1430 | 1426 | ||
1431 | if (obj->type != ACPI_TYPE_INTEGER) { | 1427 | if (obj->type != ACPI_TYPE_INTEGER) { |
1432 | printk(KERN_ERR PREFIX "Invalid _DOD data\n"); | 1428 | printk(KERN_ERR PREFIX "Invalid _DOD data\n"); |
@@ -1612,7 +1608,7 @@ static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) | |||
1612 | 1608 | ||
1613 | static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) | 1609 | static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) |
1614 | { | 1610 | { |
1615 | struct acpi_video_bus *video = (struct acpi_video_bus *)data; | 1611 | struct acpi_video_bus *video = data; |
1616 | struct acpi_device *device = NULL; | 1612 | struct acpi_device *device = NULL; |
1617 | 1613 | ||
1618 | printk("video bus notify\n"); | 1614 | printk("video bus notify\n"); |
@@ -1654,8 +1650,7 @@ static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data) | |||
1654 | 1650 | ||
1655 | static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) | 1651 | static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data) |
1656 | { | 1652 | { |
1657 | struct acpi_video_device *video_device = | 1653 | struct acpi_video_device *video_device = data; |
1658 | (struct acpi_video_device *)data; | ||
1659 | struct acpi_device *device = NULL; | 1654 | struct acpi_device *device = NULL; |
1660 | 1655 | ||
1661 | 1656 | ||
@@ -1757,7 +1752,7 @@ static int acpi_video_bus_remove(struct acpi_device *device, int type) | |||
1757 | if (!device || !acpi_driver_data(device)) | 1752 | if (!device || !acpi_driver_data(device)) |
1758 | return -EINVAL; | 1753 | return -EINVAL; |
1759 | 1754 | ||
1760 | video = (struct acpi_video_bus *)acpi_driver_data(device); | 1755 | video = acpi_driver_data(device); |
1761 | 1756 | ||
1762 | acpi_video_bus_stop_devices(video); | 1757 | acpi_video_bus_stop_devices(video); |
1763 | 1758 | ||