diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 99 |
1 files changed, 44 insertions, 55 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 33c502e56026..f7eb12e55602 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -190,6 +190,7 @@ struct acpi_video_device { | |||
190 | /* bus */ | 190 | /* bus */ |
191 | static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file); | 191 | static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file); |
192 | static struct file_operations acpi_video_bus_info_fops = { | 192 | static struct file_operations acpi_video_bus_info_fops = { |
193 | .owner = THIS_MODULE, | ||
193 | .open = acpi_video_bus_info_open_fs, | 194 | .open = acpi_video_bus_info_open_fs, |
194 | .read = seq_read, | 195 | .read = seq_read, |
195 | .llseek = seq_lseek, | 196 | .llseek = seq_lseek, |
@@ -198,6 +199,7 @@ static struct file_operations acpi_video_bus_info_fops = { | |||
198 | 199 | ||
199 | static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file); | 200 | static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file); |
200 | static struct file_operations acpi_video_bus_ROM_fops = { | 201 | static struct file_operations acpi_video_bus_ROM_fops = { |
202 | .owner = THIS_MODULE, | ||
201 | .open = acpi_video_bus_ROM_open_fs, | 203 | .open = acpi_video_bus_ROM_open_fs, |
202 | .read = seq_read, | 204 | .read = seq_read, |
203 | .llseek = seq_lseek, | 205 | .llseek = seq_lseek, |
@@ -207,6 +209,7 @@ static struct file_operations acpi_video_bus_ROM_fops = { | |||
207 | static int acpi_video_bus_POST_info_open_fs(struct inode *inode, | 209 | static int acpi_video_bus_POST_info_open_fs(struct inode *inode, |
208 | struct file *file); | 210 | struct file *file); |
209 | static struct file_operations acpi_video_bus_POST_info_fops = { | 211 | static struct file_operations acpi_video_bus_POST_info_fops = { |
212 | .owner = THIS_MODULE, | ||
210 | .open = acpi_video_bus_POST_info_open_fs, | 213 | .open = acpi_video_bus_POST_info_open_fs, |
211 | .read = seq_read, | 214 | .read = seq_read, |
212 | .llseek = seq_lseek, | 215 | .llseek = seq_lseek, |
@@ -215,6 +218,7 @@ static struct file_operations acpi_video_bus_POST_info_fops = { | |||
215 | 218 | ||
216 | static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file); | 219 | static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file); |
217 | static struct file_operations acpi_video_bus_POST_fops = { | 220 | static struct file_operations acpi_video_bus_POST_fops = { |
221 | .owner = THIS_MODULE, | ||
218 | .open = acpi_video_bus_POST_open_fs, | 222 | .open = acpi_video_bus_POST_open_fs, |
219 | .read = seq_read, | 223 | .read = seq_read, |
220 | .llseek = seq_lseek, | 224 | .llseek = seq_lseek, |
@@ -223,6 +227,7 @@ static struct file_operations acpi_video_bus_POST_fops = { | |||
223 | 227 | ||
224 | static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file); | 228 | static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file); |
225 | static struct file_operations acpi_video_bus_DOS_fops = { | 229 | static struct file_operations acpi_video_bus_DOS_fops = { |
230 | .owner = THIS_MODULE, | ||
226 | .open = acpi_video_bus_DOS_open_fs, | 231 | .open = acpi_video_bus_DOS_open_fs, |
227 | .read = seq_read, | 232 | .read = seq_read, |
228 | .llseek = seq_lseek, | 233 | .llseek = seq_lseek, |
@@ -233,6 +238,7 @@ static struct file_operations acpi_video_bus_DOS_fops = { | |||
233 | static int acpi_video_device_info_open_fs(struct inode *inode, | 238 | static int acpi_video_device_info_open_fs(struct inode *inode, |
234 | struct file *file); | 239 | struct file *file); |
235 | static struct file_operations acpi_video_device_info_fops = { | 240 | static struct file_operations acpi_video_device_info_fops = { |
241 | .owner = THIS_MODULE, | ||
236 | .open = acpi_video_device_info_open_fs, | 242 | .open = acpi_video_device_info_open_fs, |
237 | .read = seq_read, | 243 | .read = seq_read, |
238 | .llseek = seq_lseek, | 244 | .llseek = seq_lseek, |
@@ -242,6 +248,7 @@ static struct file_operations acpi_video_device_info_fops = { | |||
242 | static int acpi_video_device_state_open_fs(struct inode *inode, | 248 | static int acpi_video_device_state_open_fs(struct inode *inode, |
243 | struct file *file); | 249 | struct file *file); |
244 | static struct file_operations acpi_video_device_state_fops = { | 250 | static struct file_operations acpi_video_device_state_fops = { |
251 | .owner = THIS_MODULE, | ||
245 | .open = acpi_video_device_state_open_fs, | 252 | .open = acpi_video_device_state_open_fs, |
246 | .read = seq_read, | 253 | .read = seq_read, |
247 | .llseek = seq_lseek, | 254 | .llseek = seq_lseek, |
@@ -251,6 +258,7 @@ static struct file_operations acpi_video_device_state_fops = { | |||
251 | static int acpi_video_device_brightness_open_fs(struct inode *inode, | 258 | static int acpi_video_device_brightness_open_fs(struct inode *inode, |
252 | struct file *file); | 259 | struct file *file); |
253 | static struct file_operations acpi_video_device_brightness_fops = { | 260 | static struct file_operations acpi_video_device_brightness_fops = { |
261 | .owner = THIS_MODULE, | ||
254 | .open = acpi_video_device_brightness_open_fs, | 262 | .open = acpi_video_device_brightness_open_fs, |
255 | .read = seq_read, | 263 | .read = seq_read, |
256 | .llseek = seq_lseek, | 264 | .llseek = seq_lseek, |
@@ -260,6 +268,7 @@ static struct file_operations acpi_video_device_brightness_fops = { | |||
260 | static int acpi_video_device_EDID_open_fs(struct inode *inode, | 268 | static int acpi_video_device_EDID_open_fs(struct inode *inode, |
261 | struct file *file); | 269 | struct file *file); |
262 | static struct file_operations acpi_video_device_EDID_fops = { | 270 | static struct file_operations acpi_video_device_EDID_fops = { |
271 | .owner = THIS_MODULE, | ||
263 | .open = acpi_video_device_EDID_open_fs, | 272 | .open = acpi_video_device_EDID_open_fs, |
264 | .read = seq_read, | 273 | .read = seq_read, |
265 | .llseek = seq_lseek, | 274 | .llseek = seq_lseek, |
@@ -1061,47 +1070,37 @@ static int acpi_video_device_add_fs(struct acpi_device *device) | |||
1061 | device_dir->owner = THIS_MODULE; | 1070 | device_dir->owner = THIS_MODULE; |
1062 | 1071 | ||
1063 | /* 'info' [R] */ | 1072 | /* 'info' [R] */ |
1064 | entry = create_proc_entry("info", S_IRUGO, device_dir); | 1073 | entry = proc_create_data("info", S_IRUGO, acpi_device_dir(device), |
1074 | &acpi_video_device_info_fops, acpi_driver_data(device)); | ||
1065 | if (!entry) | 1075 | if (!entry) |
1066 | goto err_remove_dir; | 1076 | goto err_remove_dir; |
1067 | 1077 | ||
1068 | entry->proc_fops = &acpi_video_device_info_fops; | ||
1069 | entry->data = acpi_driver_data(device); | ||
1070 | entry->owner = THIS_MODULE; | ||
1071 | |||
1072 | /* 'state' [R/W] */ | 1078 | /* 'state' [R/W] */ |
1073 | entry = create_proc_entry("state", S_IFREG | S_IRUGO | S_IWUSR, | 1079 | acpi_video_device_state_fops.write = acpi_video_device_write_state; |
1074 | device_dir); | 1080 | entry = proc_create_data("state", S_IFREG | S_IRUGO | S_IWUSR, |
1081 | acpi_device_dir(device), | ||
1082 | &acpi_video_device_state_fops, | ||
1083 | acpi_driver_data(device)); | ||
1075 | if (!entry) | 1084 | if (!entry) |
1076 | goto err_remove_info; | 1085 | goto err_remove_info; |
1077 | 1086 | ||
1078 | acpi_video_device_state_fops.write = acpi_video_device_write_state; | ||
1079 | entry->proc_fops = &acpi_video_device_state_fops; | ||
1080 | entry->data = acpi_driver_data(device); | ||
1081 | entry->owner = THIS_MODULE; | ||
1082 | |||
1083 | /* 'brightness' [R/W] */ | 1087 | /* 'brightness' [R/W] */ |
1084 | entry = create_proc_entry("brightness", S_IFREG | S_IRUGO | S_IWUSR, | 1088 | acpi_video_device_brightness_fops.write = |
1085 | device_dir); | 1089 | acpi_video_device_write_brightness; |
1090 | entry = proc_create_data("brightness", S_IFREG | S_IRUGO | S_IWUSR, | ||
1091 | acpi_device_dir(device), | ||
1092 | &acpi_video_device_brightness_fops, | ||
1093 | acpi_driver_data(device)); | ||
1086 | if (!entry) | 1094 | if (!entry) |
1087 | goto err_remove_state; | 1095 | goto err_remove_state; |
1088 | 1096 | ||
1089 | acpi_video_device_brightness_fops.write = | ||
1090 | acpi_video_device_write_brightness; | ||
1091 | entry->proc_fops = &acpi_video_device_brightness_fops; | ||
1092 | entry->data = acpi_driver_data(device); | ||
1093 | entry->owner = THIS_MODULE; | ||
1094 | |||
1095 | /* 'EDID' [R] */ | 1097 | /* 'EDID' [R] */ |
1096 | entry = create_proc_entry("EDID", S_IRUGO, device_dir); | 1098 | entry = proc_create_data("EDID", S_IRUGO, acpi_device_dir(device), |
1099 | &acpi_video_device_EDID_fops, | ||
1100 | acpi_driver_data(device)); | ||
1097 | if (!entry) | 1101 | if (!entry) |
1098 | goto err_remove_brightness; | 1102 | goto err_remove_brightness; |
1099 | 1103 | ||
1100 | entry->proc_fops = &acpi_video_device_EDID_fops; | ||
1101 | entry->data = acpi_driver_data(device); | ||
1102 | entry->owner = THIS_MODULE; | ||
1103 | |||
1104 | acpi_device_dir(device) = device_dir; | ||
1105 | return 0; | 1104 | return 0; |
1106 | 1105 | ||
1107 | err_remove_brightness: | 1106 | err_remove_brightness: |
@@ -1347,54 +1346,44 @@ static int acpi_video_bus_add_fs(struct acpi_device *device) | |||
1347 | device_dir->owner = THIS_MODULE; | 1346 | device_dir->owner = THIS_MODULE; |
1348 | 1347 | ||
1349 | /* 'info' [R] */ | 1348 | /* 'info' [R] */ |
1350 | entry = create_proc_entry("info", S_IRUGO, device_dir); | 1349 | entry = proc_create_data("info", S_IRUGO, acpi_device_dir(device), |
1350 | &acpi_video_bus_info_fops, | ||
1351 | acpi_driver_data(device)); | ||
1351 | if (!entry) | 1352 | if (!entry) |
1352 | goto err_remove_dir; | 1353 | goto err_remove_dir; |
1353 | 1354 | ||
1354 | entry->proc_fops = &acpi_video_bus_info_fops; | ||
1355 | entry->data = acpi_driver_data(device); | ||
1356 | entry->owner = THIS_MODULE; | ||
1357 | |||
1358 | /* 'ROM' [R] */ | 1355 | /* 'ROM' [R] */ |
1359 | entry = create_proc_entry("ROM", S_IRUGO, device_dir); | 1356 | entry = proc_create_data("ROM", S_IRUGO, acpi_device_dir(device), |
1357 | &acpi_video_bus_ROM_fops, | ||
1358 | acpi_driver_data(device)); | ||
1360 | if (!entry) | 1359 | if (!entry) |
1361 | goto err_remove_info; | 1360 | goto err_remove_info; |
1362 | 1361 | ||
1363 | entry->proc_fops = &acpi_video_bus_ROM_fops; | ||
1364 | entry->data = acpi_driver_data(device); | ||
1365 | entry->owner = THIS_MODULE; | ||
1366 | |||
1367 | /* 'POST_info' [R] */ | 1362 | /* 'POST_info' [R] */ |
1368 | entry = create_proc_entry("POST_info", S_IRUGO, device_dir); | 1363 | entry = proc_create_data("POST_info", S_IRUGO, acpi_device_dir(device), |
1364 | &acpi_video_bus_POST_info_fops, | ||
1365 | acpi_driver_data(device)); | ||
1369 | if (!entry) | 1366 | if (!entry) |
1370 | goto err_remove_rom; | 1367 | goto err_remove_rom; |
1371 | 1368 | ||
1372 | entry->proc_fops = &acpi_video_bus_POST_info_fops; | ||
1373 | entry->data = acpi_driver_data(device); | ||
1374 | entry->owner = THIS_MODULE; | ||
1375 | |||
1376 | /* 'POST' [R/W] */ | 1369 | /* 'POST' [R/W] */ |
1377 | entry = create_proc_entry("POST", S_IFREG | S_IRUGO | S_IWUSR, | 1370 | acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; |
1378 | device_dir); | 1371 | entry = proc_create_data("POST", S_IFREG | S_IRUGO | S_IWUSR, |
1372 | acpi_device_dir(device), | ||
1373 | &acpi_video_bus_POST_fops, | ||
1374 | acpi_driver_data(device)); | ||
1379 | if (!entry) | 1375 | if (!entry) |
1380 | goto err_remove_post_info; | 1376 | goto err_remove_post_info; |
1381 | 1377 | ||
1382 | acpi_video_bus_POST_fops.write = acpi_video_bus_write_POST; | ||
1383 | entry->proc_fops = &acpi_video_bus_POST_fops; | ||
1384 | entry->data = acpi_driver_data(device); | ||
1385 | entry->owner = THIS_MODULE; | ||
1386 | |||
1387 | /* 'DOS' [R/W] */ | 1378 | /* 'DOS' [R/W] */ |
1388 | entry = create_proc_entry("DOS", S_IFREG | S_IRUGO | S_IWUSR, | 1379 | acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; |
1389 | device_dir); | 1380 | entry = proc_create_data("DOS", S_IFREG | S_IRUGO | S_IWUSR, |
1381 | acpi_device_dir(device), | ||
1382 | &acpi_video_bus_DOS_fops, | ||
1383 | acpi_driver_data(device)); | ||
1390 | if (!entry) | 1384 | if (!entry) |
1391 | goto err_remove_post; | 1385 | goto err_remove_post; |
1392 | 1386 | ||
1393 | acpi_video_bus_DOS_fops.write = acpi_video_bus_write_DOS; | ||
1394 | entry->proc_fops = &acpi_video_bus_DOS_fops; | ||
1395 | entry->data = acpi_driver_data(device); | ||
1396 | entry->owner = THIS_MODULE; | ||
1397 | |||
1398 | video->dir = acpi_device_dir(device) = device_dir; | 1387 | video->dir = acpi_device_dir(device) = device_dir; |
1399 | return 0; | 1388 | return 0; |
1400 | 1389 | ||