hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/acpi/proc.c
....@@ -10,26 +10,21 @@
1010 #include "sleep.h"
1111 #include "internal.h"
1212
13
-#define _COMPONENT ACPI_SYSTEM_COMPONENT
14
-
1513 /*
1614 * this file provides support for:
1715 * /proc/acpi/wakeup
1816 */
1917
20
-ACPI_MODULE_NAME("sleep")
21
-
2218 static int
2319 acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset)
2420 {
25
- struct list_head *node, *next;
21
+ struct acpi_device *dev, *tmp;
2622
2723 seq_printf(seq, "Device\tS-state\t Status Sysfs node\n");
2824
2925 mutex_lock(&acpi_device_lock);
30
- list_for_each_safe(node, next, &acpi_wakeup_device_list) {
31
- struct acpi_device *dev =
32
- container_of(node, struct acpi_device, wakeup_list);
26
+ list_for_each_entry_safe(dev, tmp, &acpi_wakeup_device_list,
27
+ wakeup_list) {
3328 struct acpi_device_physical_node *entry;
3429
3530 if (!dev->wakeup.flags.valid)
....@@ -96,7 +91,7 @@
9691 const char __user * buffer,
9792 size_t count, loff_t * ppos)
9893 {
99
- struct list_head *node, *next;
94
+ struct acpi_device *dev, *tmp;
10095 char strbuf[5];
10196 char str[5] = "";
10297
....@@ -109,9 +104,8 @@
109104 sscanf(strbuf, "%s", str);
110105
111106 mutex_lock(&acpi_device_lock);
112
- list_for_each_safe(node, next, &acpi_wakeup_device_list) {
113
- struct acpi_device *dev =
114
- container_of(node, struct acpi_device, wakeup_list);
107
+ list_for_each_entry_safe(dev, tmp, &acpi_wakeup_device_list,
108
+ wakeup_list) {
115109 if (!dev->wakeup.flags.valid)
116110 continue;
117111
....@@ -136,18 +130,17 @@
136130 PDE_DATA(inode));
137131 }
138132
139
-static const struct file_operations acpi_system_wakeup_device_fops = {
140
- .owner = THIS_MODULE,
141
- .open = acpi_system_wakeup_device_open_fs,
142
- .read = seq_read,
143
- .write = acpi_system_write_wakeup_device,
144
- .llseek = seq_lseek,
145
- .release = single_release,
133
+static const struct proc_ops acpi_system_wakeup_device_proc_ops = {
134
+ .proc_open = acpi_system_wakeup_device_open_fs,
135
+ .proc_read = seq_read,
136
+ .proc_write = acpi_system_write_wakeup_device,
137
+ .proc_lseek = seq_lseek,
138
+ .proc_release = single_release,
146139 };
147140
148141 void __init acpi_sleep_proc_init(void)
149142 {
150143 /* 'wakeup device' [R/W] */
151144 proc_create("wakeup", S_IFREG | S_IRUGO | S_IWUSR,
152
- acpi_root_dir, &acpi_system_wakeup_device_fops);
145
+ acpi_root_dir, &acpi_system_wakeup_device_proc_ops);
153146 }