aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ac.c12
-rw-r--r--drivers/acpi/battery.c12
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/button.c24
-rw-r--r--drivers/acpi/ec.c11
-rw-r--r--drivers/acpi/event.c8
-rw-r--r--drivers/acpi/fan.c14
-rw-r--r--drivers/acpi/power.c11
-rw-r--r--drivers/acpi/processor_core.c48
-rw-r--r--drivers/acpi/processor_idle.c13
-rw-r--r--drivers/acpi/processor_perflib.c13
-rw-r--r--drivers/acpi/processor_thermal.c1
-rw-r--r--drivers/acpi/processor_throttling.c1
-rw-r--r--drivers/acpi/sbs.c35
-rw-r--r--drivers/acpi/sleep/proc.c26
-rw-r--r--drivers/acpi/system.c27
-rw-r--r--drivers/acpi/thermal.c67
-rw-r--r--drivers/acpi/video.c99
18 files changed, 173 insertions, 251 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
index 43a95e5640de..5b73f6a2cd86 100644
--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -92,6 +92,7 @@ struct acpi_ac {
92 92
93#ifdef CONFIG_ACPI_PROCFS_POWER 93#ifdef CONFIG_ACPI_PROCFS_POWER
94static const struct file_operations acpi_ac_fops = { 94static const struct file_operations acpi_ac_fops = {
95 .owner = THIS_MODULE,
95 .open = acpi_ac_open_fs, 96 .open = acpi_ac_open_fs,
96 .read = seq_read, 97 .read = seq_read,
97 .llseek = seq_lseek, 98 .llseek = seq_lseek,
@@ -195,16 +196,11 @@ static int acpi_ac_add_fs(struct acpi_device *device)
195 } 196 }
196 197
197 /* 'state' [R] */ 198 /* 'state' [R] */
198 entry = create_proc_entry(ACPI_AC_FILE_STATE, 199 entry = proc_create_data(ACPI_AC_FILE_STATE,
199 S_IRUGO, acpi_device_dir(device)); 200 S_IRUGO, acpi_device_dir(device),
201 &acpi_ac_fops, acpi_driver_data(device));
200 if (!entry) 202 if (!entry)
201 return -ENODEV; 203 return -ENODEV;
202 else {
203 entry->proc_fops = &acpi_ac_fops;
204 entry->data = acpi_driver_data(device);
205 entry->owner = THIS_MODULE;
206 }
207
208 return 0; 204 return 0;
209} 205}
210 206
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index d5729d5dc190..b1c723f9f58d 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -741,15 +741,13 @@ static int acpi_battery_add_fs(struct acpi_device *device)
741 } 741 }
742 742
743 for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) { 743 for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) {
744 entry = create_proc_entry(acpi_battery_file[i].name, 744 entry = proc_create_data(acpi_battery_file[i].name,
745 acpi_battery_file[i].mode, acpi_device_dir(device)); 745 acpi_battery_file[i].mode,
746 acpi_device_dir(device),
747 &acpi_battery_file[i].ops,
748 acpi_driver_data(device));
746 if (!entry) 749 if (!entry)
747 return -ENODEV; 750 return -ENODEV;
748 else {
749 entry->proc_fops = &acpi_battery_file[i].ops;
750 entry->data = acpi_driver_data(device);
751 entry->owner = THIS_MODULE;
752 }
753 } 751 }
754 return 0; 752 return 0;
755} 753}
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 2d1955c11833..a6dbcf4d9ef5 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -35,6 +35,7 @@
35#ifdef CONFIG_X86 35#ifdef CONFIG_X86
36#include <asm/mpspec.h> 36#include <asm/mpspec.h>
37#endif 37#endif
38#include <linux/pci.h>
38#include <acpi/acpi_bus.h> 39#include <acpi/acpi_bus.h>
39#include <acpi/acpi_drivers.h> 40#include <acpi/acpi_drivers.h>
40 41
@@ -784,6 +785,7 @@ static int __init acpi_init(void)
784 result = acpi_bus_init(); 785 result = acpi_bus_init();
785 786
786 if (!result) { 787 if (!result) {
788 pci_mmcfg_late_init();
787 if (!(pm_flags & PM_APM)) 789 if (!(pm_flags & PM_APM))
788 pm_flags |= PM_ACPI; 790 pm_flags |= PM_ACPI;
789 else { 791 else {
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 6c5da83cdb68..1dfec413588c 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -102,6 +102,7 @@ struct acpi_button {
102}; 102};
103 103
104static const struct file_operations acpi_button_info_fops = { 104static const struct file_operations acpi_button_info_fops = {
105 .owner = THIS_MODULE,
105 .open = acpi_button_info_open_fs, 106 .open = acpi_button_info_open_fs,
106 .read = seq_read, 107 .read = seq_read,
107 .llseek = seq_lseek, 108 .llseek = seq_lseek,
@@ -109,6 +110,7 @@ static const struct file_operations acpi_button_info_fops = {
109}; 110};
110 111
111static const struct file_operations acpi_button_state_fops = { 112static const struct file_operations acpi_button_state_fops = {
113 .owner = THIS_MODULE,
112 .open = acpi_button_state_open_fs, 114 .open = acpi_button_state_open_fs,
113 .read = seq_read, 115 .read = seq_read,
114 .llseek = seq_lseek, 116 .llseek = seq_lseek,
@@ -207,27 +209,21 @@ static int acpi_button_add_fs(struct acpi_device *device)
207 acpi_device_dir(device)->owner = THIS_MODULE; 209 acpi_device_dir(device)->owner = THIS_MODULE;
208 210
209 /* 'info' [R] */ 211 /* 'info' [R] */
210 entry = create_proc_entry(ACPI_BUTTON_FILE_INFO, 212 entry = proc_create_data(ACPI_BUTTON_FILE_INFO,
211 S_IRUGO, acpi_device_dir(device)); 213 S_IRUGO, acpi_device_dir(device),
214 &acpi_button_info_fops,
215 acpi_driver_data(device));
212 if (!entry) 216 if (!entry)
213 return -ENODEV; 217 return -ENODEV;
214 else {
215 entry->proc_fops = &acpi_button_info_fops;
216 entry->data = acpi_driver_data(device);
217 entry->owner = THIS_MODULE;
218 }
219 218
220 /* show lid state [R] */ 219 /* show lid state [R] */
221 if (button->type == ACPI_BUTTON_TYPE_LID) { 220 if (button->type == ACPI_BUTTON_TYPE_LID) {
222 entry = create_proc_entry(ACPI_BUTTON_FILE_STATE, 221 entry = proc_create_data(ACPI_BUTTON_FILE_STATE,
223 S_IRUGO, acpi_device_dir(device)); 222 S_IRUGO, acpi_device_dir(device),
223 &acpi_button_state_fops,
224 acpi_driver_data(device));
224 if (!entry) 225 if (!entry)
225 return -ENODEV; 226 return -ENODEV;
226 else {
227 entry->proc_fops = &acpi_button_state_fops;
228 entry->data = acpi_driver_data(device);
229 entry->owner = THIS_MODULE;
230 }
231 } 227 }
232 228
233 return 0; 229 return 0;
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 3d9362140831..0924992187e8 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -634,16 +634,11 @@ static int acpi_ec_add_fs(struct acpi_device *device)
634 return -ENODEV; 634 return -ENODEV;
635 } 635 }
636 636
637 entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO, 637 entry = proc_create_data(ACPI_EC_FILE_INFO, S_IRUGO,
638 acpi_device_dir(device)); 638 acpi_device_dir(device),
639 &acpi_ec_info_ops, acpi_driver_data(device));
639 if (!entry) 640 if (!entry)
640 return -ENODEV; 641 return -ENODEV;
641 else {
642 entry->proc_fops = &acpi_ec_info_ops;
643 entry->data = acpi_driver_data(device);
644 entry->owner = THIS_MODULE;
645 }
646
647 return 0; 642 return 0;
648} 643}
649 644
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c
index abec1ca94cf4..0c24bd4d6562 100644
--- a/drivers/acpi/event.c
+++ b/drivers/acpi/event.c
@@ -102,6 +102,7 @@ static unsigned int acpi_system_poll_event(struct file *file, poll_table * wait)
102} 102}
103 103
104static const struct file_operations acpi_system_event_ops = { 104static const struct file_operations acpi_system_event_ops = {
105 .owner = THIS_MODULE,
105 .open = acpi_system_open_event, 106 .open = acpi_system_open_event,
106 .read = acpi_system_read_event, 107 .read = acpi_system_read_event,
107 .release = acpi_system_close_event, 108 .release = acpi_system_close_event,
@@ -294,10 +295,9 @@ static int __init acpi_event_init(void)
294 295
295#ifdef CONFIG_ACPI_PROC_EVENT 296#ifdef CONFIG_ACPI_PROC_EVENT
296 /* 'event' [R] */ 297 /* 'event' [R] */
297 entry = create_proc_entry("event", S_IRUSR, acpi_root_dir); 298 entry = proc_create("event", S_IRUSR, acpi_root_dir,
298 if (entry) 299 &acpi_system_event_ops);
299 entry->proc_fops = &acpi_system_event_ops; 300 if (!entry)
300 else
301 return -ENODEV; 301 return -ENODEV;
302#endif 302#endif
303 303
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
index cf635cde836b..6cf10cbc1eee 100644
--- a/drivers/acpi/fan.c
+++ b/drivers/acpi/fan.c
@@ -192,17 +192,13 @@ static int acpi_fan_add_fs(struct acpi_device *device)
192 } 192 }
193 193
194 /* 'status' [R/W] */ 194 /* 'status' [R/W] */
195 entry = create_proc_entry(ACPI_FAN_FILE_STATE, 195 entry = proc_create_data(ACPI_FAN_FILE_STATE,
196 S_IFREG | S_IRUGO | S_IWUSR, 196 S_IFREG | S_IRUGO | S_IWUSR,
197 acpi_device_dir(device)); 197 acpi_device_dir(device),
198 &acpi_fan_state_ops,
199 device);
198 if (!entry) 200 if (!entry)
199 return -ENODEV; 201 return -ENODEV;
200 else {
201 entry->proc_fops = &acpi_fan_state_ops;
202 entry->data = device;
203 entry->owner = THIS_MODULE;
204 }
205
206 return 0; 202 return 0;
207} 203}
208 204
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index f2a76acecfcd..81e4f081a4ae 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -93,6 +93,7 @@ struct acpi_power_resource {
93static struct list_head acpi_power_resource_list; 93static struct list_head acpi_power_resource_list;
94 94
95static const struct file_operations acpi_power_fops = { 95static const struct file_operations acpi_power_fops = {
96 .owner = THIS_MODULE,
96 .open = acpi_power_open_fs, 97 .open = acpi_power_open_fs,
97 .read = seq_read, 98 .read = seq_read,
98 .llseek = seq_lseek, 99 .llseek = seq_lseek,
@@ -543,15 +544,11 @@ static int acpi_power_add_fs(struct acpi_device *device)
543 } 544 }
544 545
545 /* 'status' [R] */ 546 /* 'status' [R] */
546 entry = create_proc_entry(ACPI_POWER_FILE_STATUS, 547 entry = proc_create_data(ACPI_POWER_FILE_STATUS,
547 S_IRUGO, acpi_device_dir(device)); 548 S_IRUGO, acpi_device_dir(device),
549 &acpi_power_fops, acpi_driver_data(device));
548 if (!entry) 550 if (!entry)
549 return -EIO; 551 return -EIO;
550 else {
551 entry->proc_fops = &acpi_power_fops;
552 entry->data = acpi_driver_data(device);
553 }
554
555 return 0; 552 return 0;
556} 553}
557 554
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index ea5f628dcc15..386e5aa48834 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -112,6 +112,7 @@ static struct acpi_driver acpi_processor_driver = {
112#define UNINSTALL_NOTIFY_HANDLER 2 112#define UNINSTALL_NOTIFY_HANDLER 2
113 113
114static const struct file_operations acpi_processor_info_fops = { 114static const struct file_operations acpi_processor_info_fops = {
115 .owner = THIS_MODULE,
115 .open = acpi_processor_info_open_fs, 116 .open = acpi_processor_info_open_fs,
116 .read = seq_read, 117 .read = seq_read,
117 .llseek = seq_lseek, 118 .llseek = seq_lseek,
@@ -326,40 +327,30 @@ static int acpi_processor_add_fs(struct acpi_device *device)
326 acpi_device_dir(device)->owner = THIS_MODULE; 327 acpi_device_dir(device)->owner = THIS_MODULE;
327 328
328 /* 'info' [R] */ 329 /* 'info' [R] */
329 entry = create_proc_entry(ACPI_PROCESSOR_FILE_INFO, 330 entry = proc_create_data(ACPI_PROCESSOR_FILE_INFO,
330 S_IRUGO, acpi_device_dir(device)); 331 S_IRUGO, acpi_device_dir(device),
332 &acpi_processor_info_fops,
333 acpi_driver_data(device));
331 if (!entry) 334 if (!entry)
332 return -EIO; 335 return -EIO;
333 else {
334 entry->proc_fops = &acpi_processor_info_fops;
335 entry->data = acpi_driver_data(device);
336 entry->owner = THIS_MODULE;
337 }
338 336
339 /* 'throttling' [R/W] */ 337 /* 'throttling' [R/W] */
340 entry = create_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, 338 entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING,
341 S_IFREG | S_IRUGO | S_IWUSR, 339 S_IFREG | S_IRUGO | S_IWUSR,
342 acpi_device_dir(device)); 340 acpi_device_dir(device),
341 &acpi_processor_throttling_fops,
342 acpi_driver_data(device));
343 if (!entry) 343 if (!entry)
344 return -EIO; 344 return -EIO;
345 else {
346 entry->proc_fops = &acpi_processor_throttling_fops;
347 entry->data = acpi_driver_data(device);
348 entry->owner = THIS_MODULE;
349 }
350 345
351 /* 'limit' [R/W] */ 346 /* 'limit' [R/W] */
352 entry = create_proc_entry(ACPI_PROCESSOR_FILE_LIMIT, 347 entry = proc_create_data(ACPI_PROCESSOR_FILE_LIMIT,
353 S_IFREG | S_IRUGO | S_IWUSR, 348 S_IFREG | S_IRUGO | S_IWUSR,
354 acpi_device_dir(device)); 349 acpi_device_dir(device),
350 &acpi_processor_limit_fops,
351 acpi_driver_data(device));
355 if (!entry) 352 if (!entry)
356 return -EIO; 353 return -EIO;
357 else {
358 entry->proc_fops = &acpi_processor_limit_fops;
359 entry->data = acpi_driver_data(device);
360 entry->owner = THIS_MODULE;
361 }
362
363 return 0; 354 return 0;
364} 355}
365 356
@@ -612,6 +603,15 @@ static int acpi_processor_get_info(struct acpi_processor *pr, unsigned has_uid)
612 request_region(pr->throttling.address, 6, "ACPI CPU throttle"); 603 request_region(pr->throttling.address, 6, "ACPI CPU throttle");
613 } 604 }
614 605
606 /*
607 * If ACPI describes a slot number for this CPU, we can use it
608 * ensure we get the right value in the "physical id" field
609 * of /proc/cpuinfo
610 */
611 status = acpi_evaluate_object(pr->handle, "_SUN", NULL, &buffer);
612 if (ACPI_SUCCESS(status))
613 arch_fix_phys_package_id(pr->id, object.integer.value);
614
615 return 0; 615 return 0;
616} 616}
617 617
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 55d69dce47c4..2dd2c1f3a01c 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1286,6 +1286,7 @@ static int acpi_processor_power_open_fs(struct inode *inode, struct file *file)
1286} 1286}
1287 1287
1288static const struct file_operations acpi_processor_power_fops = { 1288static const struct file_operations acpi_processor_power_fops = {
1289 .owner = THIS_MODULE,
1289 .open = acpi_processor_power_open_fs, 1290 .open = acpi_processor_power_open_fs,
1290 .read = seq_read, 1291 .read = seq_read,
1291 .llseek = seq_lseek, 1292 .llseek = seq_lseek,
@@ -1833,16 +1834,12 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1833 } 1834 }
1834 1835
1835 /* 'power' [R] */ 1836 /* 'power' [R] */
1836 entry = create_proc_entry(ACPI_PROCESSOR_FILE_POWER, 1837 entry = proc_create_data(ACPI_PROCESSOR_FILE_POWER,
1837 S_IRUGO, acpi_device_dir(device)); 1838 S_IRUGO, acpi_device_dir(device),
1839 &acpi_processor_power_fops,
1840 acpi_driver_data(device));
1838 if (!entry) 1841 if (!entry)
1839 return -EIO; 1842 return -EIO;
1840 else {
1841 entry->proc_fops = &acpi_processor_power_fops;
1842 entry->data = acpi_driver_data(device);
1843 entry->owner = THIS_MODULE;
1844 }
1845
1846 return 0; 1843 return 0;
1847} 1844}
1848 1845
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index b477a4be8a69..d80b2d1441af 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -411,6 +411,7 @@ EXPORT_SYMBOL(acpi_processor_notify_smm);
411 411
412static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file); 412static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file);
413static struct file_operations acpi_processor_perf_fops = { 413static struct file_operations acpi_processor_perf_fops = {
414 .owner = THIS_MODULE,
414 .open = acpi_processor_perf_open_fs, 415 .open = acpi_processor_perf_open_fs,
415 .read = seq_read, 416 .read = seq_read,
416 .llseek = seq_lseek, 417 .llseek = seq_lseek,
@@ -456,7 +457,6 @@ static int acpi_processor_perf_open_fs(struct inode *inode, struct file *file)
456 457
457static void acpi_cpufreq_add_file(struct acpi_processor *pr) 458static void acpi_cpufreq_add_file(struct acpi_processor *pr)
458{ 459{
459 struct proc_dir_entry *entry = NULL;
460 struct acpi_device *device = NULL; 460 struct acpi_device *device = NULL;
461 461
462 462
@@ -464,14 +464,9 @@ static void acpi_cpufreq_add_file(struct acpi_processor *pr)
464 return; 464 return;
465 465
466 /* add file 'performance' [R/W] */ 466 /* add file 'performance' [R/W] */
467 entry = create_proc_entry(ACPI_PROCESSOR_FILE_PERFORMANCE, 467 proc_create_data(ACPI_PROCESSOR_FILE_PERFORMANCE, S_IFREG | S_IRUGO,
468 S_IFREG | S_IRUGO, 468 acpi_device_dir(device),
469 acpi_device_dir(device)); 469 &acpi_processor_perf_fops, acpi_driver_data(device));
470 if (entry){
471 entry->proc_fops = &acpi_processor_perf_fops;
472 entry->data = acpi_driver_data(device);
473 entry->owner = THIS_MODULE;
474 }
475 return; 470 return;
476} 471}
477 472
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index 649ae99b9216..ef34b18f95ca 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -509,6 +509,7 @@ static ssize_t acpi_processor_write_limit(struct file * file,
509} 509}
510 510
511struct file_operations acpi_processor_limit_fops = { 511struct file_operations acpi_processor_limit_fops = {
512 .owner = THIS_MODULE,
512 .open = acpi_processor_limit_open_fs, 513 .open = acpi_processor_limit_open_fs,
513 .read = seq_read, 514 .read = seq_read,
514 .write = acpi_processor_write_limit, 515 .write = acpi_processor_write_limit,
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 0bba3a914e86..bb06738860c4 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -1252,6 +1252,7 @@ static ssize_t acpi_processor_write_throttling(struct file *file,
1252} 1252}
1253 1253
1254struct file_operations acpi_processor_throttling_fops = { 1254struct file_operations acpi_processor_throttling_fops = {
1255 .owner = THIS_MODULE,
1255 .open = acpi_processor_throttling_open_fs, 1256 .open = acpi_processor_throttling_open_fs,
1256 .read = seq_read, 1257 .read = seq_read,
1257 .write = acpi_processor_write_throttling, 1258 .write = acpi_processor_write_throttling,
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c
index 585ae3c9c8ea..10a36512647c 100644
--- a/drivers/acpi/sbs.c
+++ b/drivers/acpi/sbs.c
@@ -483,8 +483,6 @@ acpi_sbs_add_fs(struct proc_dir_entry **dir,
483 struct file_operations *state_fops, 483 struct file_operations *state_fops,
484 struct file_operations *alarm_fops, void *data) 484 struct file_operations *alarm_fops, void *data)
485{ 485{
486 struct proc_dir_entry *entry = NULL;
487
488 if (!*dir) { 486 if (!*dir) {
489 *dir = proc_mkdir(dir_name, parent_dir); 487 *dir = proc_mkdir(dir_name, parent_dir);
490 if (!*dir) { 488 if (!*dir) {
@@ -494,34 +492,19 @@ acpi_sbs_add_fs(struct proc_dir_entry **dir,
494 } 492 }
495 493
496 /* 'info' [R] */ 494 /* 'info' [R] */
497 if (info_fops) { 495 if (info_fops)
498 entry = create_proc_entry(ACPI_SBS_FILE_INFO, S_IRUGO, *dir); 496 proc_create_data(ACPI_SBS_FILE_INFO, S_IRUGO, *dir,
499 if (entry) { 497 info_fops, data);
500 entry->proc_fops = info_fops;
501 entry->data = data;
502 entry->owner = THIS_MODULE;
503 }
504 }
505 498
506 /* 'state' [R] */ 499 /* 'state' [R] */
507 if (state_fops) { 500 if (state_fops)
508 entry = create_proc_entry(ACPI_SBS_FILE_STATE, S_IRUGO, *dir); 501 proc_create_data(ACPI_SBS_FILE_STATE, S_IRUGO, *dir,
509 if (entry) { 502 state_fops, data);
510 entry->proc_fops = state_fops;
511 entry->data = data;
512 entry->owner = THIS_MODULE;
513 }
514 }
515 503
516 /* 'alarm' [R/W] */ 504 /* 'alarm' [R/W] */
517 if (alarm_fops) { 505 if (alarm_fops)
518 entry = create_proc_entry(ACPI_SBS_FILE_ALARM, S_IRUGO, *dir); 506 proc_create_data(ACPI_SBS_FILE_ALARM, S_IRUGO, *dir,
519 if (entry) { 507 alarm_fops, data);
520 entry->proc_fops = alarm_fops;
521 entry->data = data;
522 entry->owner = THIS_MODULE;
523 }
524 }
525 return 0; 508 return 0;
526} 509}
527 510
diff --git a/drivers/acpi/sleep/proc.c b/drivers/acpi/sleep/proc.c
index f8df5217d477..8a5fe8710513 100644
--- a/drivers/acpi/sleep/proc.c
+++ b/drivers/acpi/sleep/proc.c
@@ -440,6 +440,7 @@ acpi_system_wakeup_device_open_fs(struct inode *inode, struct file *file)
440} 440}
441 441
442static const struct file_operations acpi_system_wakeup_device_fops = { 442static const struct file_operations acpi_system_wakeup_device_fops = {
443 .owner = THIS_MODULE,
443 .open = acpi_system_wakeup_device_open_fs, 444 .open = acpi_system_wakeup_device_open_fs,
444 .read = seq_read, 445 .read = seq_read,
445 .write = acpi_system_write_wakeup_device, 446 .write = acpi_system_write_wakeup_device,
@@ -449,6 +450,7 @@ static const struct file_operations acpi_system_wakeup_device_fops = {
449 450
450#ifdef CONFIG_ACPI_PROCFS 451#ifdef CONFIG_ACPI_PROCFS
451static const struct file_operations acpi_system_sleep_fops = { 452static const struct file_operations acpi_system_sleep_fops = {
453 .owner = THIS_MODULE,
452 .open = acpi_system_sleep_open_fs, 454 .open = acpi_system_sleep_open_fs,
453 .read = seq_read, 455 .read = seq_read,
454 .write = acpi_system_write_sleep, 456 .write = acpi_system_write_sleep,
@@ -459,6 +461,7 @@ static const struct file_operations acpi_system_sleep_fops = {
459 461
460#ifdef HAVE_ACPI_LEGACY_ALARM 462#ifdef HAVE_ACPI_LEGACY_ALARM
461static const struct file_operations acpi_system_alarm_fops = { 463static const struct file_operations acpi_system_alarm_fops = {
464 .owner = THIS_MODULE,
462 .open = acpi_system_alarm_open_fs, 465 .open = acpi_system_alarm_open_fs,
463 .read = seq_read, 466 .read = seq_read,
464 .write = acpi_system_write_alarm, 467 .write = acpi_system_write_alarm,
@@ -477,37 +480,26 @@ static u32 rtc_handler(void *context)
477 480
478static int __init acpi_sleep_proc_init(void) 481static int __init acpi_sleep_proc_init(void)
479{ 482{
480 struct proc_dir_entry *entry = NULL;
481
482 if (acpi_disabled) 483 if (acpi_disabled)
483 return 0; 484 return 0;
484 485
485#ifdef CONFIG_ACPI_PROCFS 486#ifdef CONFIG_ACPI_PROCFS
486 /* 'sleep' [R/W] */ 487 /* 'sleep' [R/W] */
487 entry = 488 proc_create("sleep", S_IFREG | S_IRUGO | S_IWUSR,
488 create_proc_entry("sleep", S_IFREG | S_IRUGO | S_IWUSR, 489 acpi_root_dir, &acpi_system_sleep_fops);
489 acpi_root_dir);
490 if (entry)
491 entry->proc_fops = &acpi_system_sleep_fops;
492#endif /* CONFIG_ACPI_PROCFS */ 490#endif /* CONFIG_ACPI_PROCFS */
493 491
494#ifdef HAVE_ACPI_LEGACY_ALARM 492#ifdef HAVE_ACPI_LEGACY_ALARM
495 /* 'alarm' [R/W] */ 493 /* 'alarm' [R/W] */
496 entry = 494 proc_create("alarm", S_IFREG | S_IRUGO | S_IWUSR,
497 create_proc_entry("alarm", S_IFREG | S_IRUGO | S_IWUSR, 495 acpi_root_dir, &acpi_system_alarm_fops);
498 acpi_root_dir);
499 if (entry)
500 entry->proc_fops = &acpi_system_alarm_fops;
501 496
502 acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL); 497 acpi_install_fixed_event_handler(ACPI_EVENT_RTC, rtc_handler, NULL);
503#endif /* HAVE_ACPI_LEGACY_ALARM */ 498#endif /* HAVE_ACPI_LEGACY_ALARM */
504 499
505 /* 'wakeup device' [R/W] */ 500 /* 'wakeup device' [R/W] */
506 entry = 501 proc_create("wakeup", S_IFREG | S_IRUGO | S_IWUSR,
507 create_proc_entry("wakeup", S_IFREG | S_IRUGO | S_IWUSR, 502 acpi_root_dir, &acpi_system_wakeup_device_fops);
508 acpi_root_dir);
509 if (entry)
510 entry->proc_fops = &acpi_system_wakeup_device_fops;
511 503
512 return 0; 504 return 0;
513} 505}
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index 4749f379a915..769f24855eb6 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -396,6 +396,7 @@ static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
396} 396}
397 397
398static const struct file_operations acpi_system_info_ops = { 398static const struct file_operations acpi_system_info_ops = {
399 .owner = THIS_MODULE,
399 .open = acpi_system_info_open_fs, 400 .open = acpi_system_info_open_fs,
400 .read = seq_read, 401 .read = seq_read,
401 .llseek = seq_lseek, 402 .llseek = seq_lseek,
@@ -406,6 +407,7 @@ static ssize_t acpi_system_read_dsdt(struct file *, char __user *, size_t,
406 loff_t *); 407 loff_t *);
407 408
408static const struct file_operations acpi_system_dsdt_ops = { 409static const struct file_operations acpi_system_dsdt_ops = {
410 .owner = THIS_MODULE,
409 .read = acpi_system_read_dsdt, 411 .read = acpi_system_read_dsdt,
410}; 412};
411 413
@@ -430,6 +432,7 @@ static ssize_t acpi_system_read_fadt(struct file *, char __user *, size_t,
430 loff_t *); 432 loff_t *);
431 433
432static const struct file_operations acpi_system_fadt_ops = { 434static const struct file_operations acpi_system_fadt_ops = {
435 .owner = THIS_MODULE,
433 .read = acpi_system_read_fadt, 436 .read = acpi_system_read_fadt,
434}; 437};
435 438
@@ -454,31 +457,23 @@ static int acpi_system_procfs_init(void)
454{ 457{
455 struct proc_dir_entry *entry; 458 struct proc_dir_entry *entry;
456 int error = 0; 459 int error = 0;
457 char *name;
458 460
459 /* 'info' [R] */ 461 /* 'info' [R] */
460 name = ACPI_SYSTEM_FILE_INFO; 462 entry = proc_create(ACPI_SYSTEM_FILE_INFO, S_IRUGO, acpi_root_dir,
461 entry = create_proc_entry(name, S_IRUGO, acpi_root_dir); 463 &acpi_system_info_ops);
462 if (!entry) 464 if (!entry)
463 goto Error; 465 goto Error;
464 else {
465 entry->proc_fops = &acpi_system_info_ops;
466 }
467 466
468 /* 'dsdt' [R] */ 467 /* 'dsdt' [R] */
469 name = ACPI_SYSTEM_FILE_DSDT; 468 entry = proc_create(ACPI_SYSTEM_FILE_DSDT, S_IRUSR, acpi_root_dir,
470 entry = create_proc_entry(name, S_IRUSR, acpi_root_dir); 469 &acpi_system_dsdt_ops);
471 if (entry) 470 if (!entry)
472 entry->proc_fops = &acpi_system_dsdt_ops;
473 else
474 goto Error; 471 goto Error;
475 472
476 /* 'fadt' [R] */ 473 /* 'fadt' [R] */
477 name = ACPI_SYSTEM_FILE_FADT; 474 entry = proc_create(ACPI_SYSTEM_FILE_FADT, S_IRUSR, acpi_root_dir,
478 entry = create_proc_entry(name, S_IRUSR, acpi_root_dir); 475 &acpi_system_fadt_ops);
479 if (entry) 476 if (!entry)
480 entry->proc_fops = &acpi_system_fadt_ops;
481 else
482 goto Error; 477 goto Error;
483 478
484 Done: 479 Done:
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 782c2250443e..504385b1f211 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -198,6 +198,7 @@ struct acpi_thermal {
198}; 198};
199 199
200static const struct file_operations acpi_thermal_state_fops = { 200static const struct file_operations acpi_thermal_state_fops = {
201 .owner = THIS_MODULE,
201 .open = acpi_thermal_state_open_fs, 202 .open = acpi_thermal_state_open_fs,
202 .read = seq_read, 203 .read = seq_read,
203 .llseek = seq_lseek, 204 .llseek = seq_lseek,
@@ -205,6 +206,7 @@ static const struct file_operations acpi_thermal_state_fops = {
205}; 206};
206 207
207static const struct file_operations acpi_thermal_temp_fops = { 208static const struct file_operations acpi_thermal_temp_fops = {
209 .owner = THIS_MODULE,
208 .open = acpi_thermal_temp_open_fs, 210 .open = acpi_thermal_temp_open_fs,
209 .read = seq_read, 211 .read = seq_read,
210 .llseek = seq_lseek, 212 .llseek = seq_lseek,
@@ -212,6 +214,7 @@ static const struct file_operations acpi_thermal_temp_fops = {
212}; 214};
213 215
214static const struct file_operations acpi_thermal_trip_fops = { 216static const struct file_operations acpi_thermal_trip_fops = {
217 .owner = THIS_MODULE,
215 .open = acpi_thermal_trip_open_fs, 218 .open = acpi_thermal_trip_open_fs,
216 .read = seq_read, 219 .read = seq_read,
217 .llseek = seq_lseek, 220 .llseek = seq_lseek,
@@ -219,6 +222,7 @@ static const struct file_operations acpi_thermal_trip_fops = {
219}; 222};
220 223
221static const struct file_operations acpi_thermal_cooling_fops = { 224static const struct file_operations acpi_thermal_cooling_fops = {
225 .owner = THIS_MODULE,
222 .open = acpi_thermal_cooling_open_fs, 226 .open = acpi_thermal_cooling_open_fs,
223 .read = seq_read, 227 .read = seq_read,
224 .write = acpi_thermal_write_cooling_mode, 228 .write = acpi_thermal_write_cooling_mode,
@@ -227,6 +231,7 @@ static const struct file_operations acpi_thermal_cooling_fops = {
227}; 231};
228 232
229static const struct file_operations acpi_thermal_polling_fops = { 233static const struct file_operations acpi_thermal_polling_fops = {
234 .owner = THIS_MODULE,
230 .open = acpi_thermal_polling_open_fs, 235 .open = acpi_thermal_polling_open_fs,
231 .read = seq_read, 236 .read = seq_read,
232 .write = acpi_thermal_write_polling, 237 .write = acpi_thermal_write_polling,
@@ -1437,63 +1442,47 @@ static int acpi_thermal_add_fs(struct acpi_device *device)
1437 } 1442 }
1438 1443
1439 /* 'state' [R] */ 1444 /* 'state' [R] */
1440 entry = create_proc_entry(ACPI_THERMAL_FILE_STATE, 1445 entry = proc_create_data(ACPI_THERMAL_FILE_STATE,
1441 S_IRUGO, acpi_device_dir(device)); 1446 S_IRUGO, acpi_device_dir(device),
1447 &acpi_thermal_state_fops,
1448 acpi_driver_data(device));
1442 if (!entry) 1449 if (!entry)
1443 return -ENODEV; 1450 return -ENODEV;
1444 else {
1445 entry->proc_fops = &acpi_thermal_state_fops;
1446 entry->data = acpi_driver_data(device);
1447 entry->owner = THIS_MODULE;
1448 }
1449 1451
1450 /* 'temperature' [R] */ 1452 /* 'temperature' [R] */
1451 entry = create_proc_entry(ACPI_THERMAL_FILE_TEMPERATURE, 1453 entry = proc_create_data(ACPI_THERMAL_FILE_TEMPERATURE,
1452 S_IRUGO, acpi_device_dir(device)); 1454 S_IRUGO, acpi_device_dir(device),
1455 &acpi_thermal_temp_fops,
1456 acpi_driver_data(device));
1453 if (!entry) 1457 if (!entry)
1454 return -ENODEV; 1458 return -ENODEV;
1455 else {
1456 entry->proc_fops = &acpi_thermal_temp_fops;
1457 entry->data = acpi_driver_data(device);
1458 entry->owner = THIS_MODULE;
1459 }
1460 1459
1461 /* 'trip_points' [R] */ 1460 /* 'trip_points' [R] */
1462 entry = create_proc_entry(ACPI_THERMAL_FILE_TRIP_POINTS, 1461 entry = proc_create_data(ACPI_THERMAL_FILE_TRIP_POINTS,
1463 S_IRUGO, 1462 S_IRUGO,
1464 acpi_device_dir(device)); 1463 acpi_device_dir(device),
1464 &acpi_thermal_trip_fops,
1465 acpi_driver_data(device));
1465 if (!entry) 1466 if (!entry)
1466 return -ENODEV; 1467 return -ENODEV;
1467 else {
1468 entry->proc_fops = &acpi_thermal_trip_fops;
1469 entry->data = acpi_driver_data(device);
1470 entry->owner = THIS_MODULE;
1471 }
1472 1468
1473 /* 'cooling_mode' [R/W] */ 1469 /* 'cooling_mode' [R/W] */
1474 entry = create_proc_entry(ACPI_THERMAL_FILE_COOLING_MODE, 1470 entry = proc_create_data(ACPI_THERMAL_FILE_COOLING_MODE,
1475 S_IFREG | S_IRUGO | S_IWUSR, 1471 S_IFREG | S_IRUGO | S_IWUSR,
1476 acpi_device_dir(device)); 1472 acpi_device_dir(device),
1473 &acpi_thermal_cooling_fops,
1474 acpi_driver_data(device));
1477 if (!entry) 1475 if (!entry)
1478 return -ENODEV; 1476 return -ENODEV;
1479 else {
1480 entry->proc_fops = &acpi_thermal_cooling_fops;
1481 entry->data = acpi_driver_data(device);
1482 entry->owner = THIS_MODULE;
1483 }
1484 1477
1485 /* 'polling_frequency' [R/W] */ 1478 /* 'polling_frequency' [R/W] */
1486 entry = create_proc_entry(ACPI_THERMAL_FILE_POLLING_FREQ, 1479 entry = proc_create_data(ACPI_THERMAL_FILE_POLLING_FREQ,
1487 S_IFREG | S_IRUGO | S_IWUSR, 1480 S_IFREG | S_IRUGO | S_IWUSR,
1488 acpi_device_dir(device)); 1481 acpi_device_dir(device),
1482 &acpi_thermal_polling_fops,
1483 acpi_driver_data(device));
1489 if (!entry) 1484 if (!entry)
1490 return -ENODEV; 1485 return -ENODEV;
1491 else {
1492 entry->proc_fops = &acpi_thermal_polling_fops;
1493 entry->data = acpi_driver_data(device);
1494 entry->owner = THIS_MODULE;
1495 }
1496
1497 return 0; 1486 return 0;
1498} 1487}
1499 1488
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 */
191static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file); 191static int acpi_video_bus_info_open_fs(struct inode *inode, struct file *file);
192static struct file_operations acpi_video_bus_info_fops = { 192static 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
199static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file); 200static int acpi_video_bus_ROM_open_fs(struct inode *inode, struct file *file);
200static struct file_operations acpi_video_bus_ROM_fops = { 201static 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 = {
207static int acpi_video_bus_POST_info_open_fs(struct inode *inode, 209static int acpi_video_bus_POST_info_open_fs(struct inode *inode,
208 struct file *file); 210 struct file *file);
209static struct file_operations acpi_video_bus_POST_info_fops = { 211static 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
216static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file); 219static int acpi_video_bus_POST_open_fs(struct inode *inode, struct file *file);
217static struct file_operations acpi_video_bus_POST_fops = { 220static 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
224static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file); 228static int acpi_video_bus_DOS_open_fs(struct inode *inode, struct file *file);
225static struct file_operations acpi_video_bus_DOS_fops = { 229static 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 = {
233static int acpi_video_device_info_open_fs(struct inode *inode, 238static int acpi_video_device_info_open_fs(struct inode *inode,
234 struct file *file); 239 struct file *file);
235static struct file_operations acpi_video_device_info_fops = { 240static 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 = {
242static int acpi_video_device_state_open_fs(struct inode *inode, 248static int acpi_video_device_state_open_fs(struct inode *inode,
243 struct file *file); 249 struct file *file);
244static struct file_operations acpi_video_device_state_fops = { 250static 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 = {
251static int acpi_video_device_brightness_open_fs(struct inode *inode, 258static int acpi_video_device_brightness_open_fs(struct inode *inode,
252 struct file *file); 259 struct file *file);
253static struct file_operations acpi_video_device_brightness_fops = { 260static 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 = {
260static int acpi_video_device_EDID_open_fs(struct inode *inode, 268static int acpi_video_device_EDID_open_fs(struct inode *inode,
261 struct file *file); 269 struct file *file);
262static struct file_operations acpi_video_device_EDID_fops = { 270static 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