13
13
#include <linux/types.h>
14
14
#include <linux/dmi.h>
15
15
#include <linux/delay.h>
16
- #ifdef CONFIG_ACPI_PROCFS_POWER
17
- #include <linux/proc_fs.h>
18
- #include <linux/seq_file.h>
19
- #endif
20
16
#include <linux/platform_device.h>
21
17
#include <linux/power_supply.h>
22
18
#include <linux/acpi.h>
@@ -66,12 +62,6 @@ static int acpi_ac_resume(struct device *dev);
66
62
#endif
67
63
static SIMPLE_DEV_PM_OPS (acpi_ac_pm , NULL, acpi_ac_resume ) ;
68
64
69
- #ifdef CONFIG_ACPI_PROCFS_POWER
70
- extern struct proc_dir_entry * acpi_lock_ac_dir (void );
71
- extern void * acpi_unlock_ac_dir (struct proc_dir_entry * acpi_ac_dir );
72
- #endif
73
-
74
-
75
65
static int ac_sleep_before_get_state_ms ;
76
66
static int ac_check_pmic = 1 ;
77
67
@@ -150,77 +140,6 @@ static enum power_supply_property ac_props[] = {
150
140
POWER_SUPPLY_PROP_ONLINE ,
151
141
};
152
142
153
- #ifdef CONFIG_ACPI_PROCFS_POWER
154
- /* --------------------------------------------------------------------------
155
- FS Interface (/proc)
156
- -------------------------------------------------------------------------- */
157
-
158
- static struct proc_dir_entry * acpi_ac_dir ;
159
-
160
- static int acpi_ac_seq_show (struct seq_file * seq , void * offset )
161
- {
162
- struct acpi_ac * ac = seq -> private ;
163
-
164
-
165
- if (!ac )
166
- return 0 ;
167
-
168
- if (acpi_ac_get_state (ac )) {
169
- seq_puts (seq , "ERROR: Unable to read AC Adapter state\n" );
170
- return 0 ;
171
- }
172
-
173
- seq_puts (seq , "state: " );
174
- switch (ac -> state ) {
175
- case ACPI_AC_STATUS_OFFLINE :
176
- seq_puts (seq , "off-line\n" );
177
- break ;
178
- case ACPI_AC_STATUS_ONLINE :
179
- seq_puts (seq , "on-line\n" );
180
- break ;
181
- default :
182
- seq_puts (seq , "unknown\n" );
183
- break ;
184
- }
185
-
186
- return 0 ;
187
- }
188
-
189
- static int acpi_ac_add_fs (struct acpi_ac * ac )
190
- {
191
- struct proc_dir_entry * entry = NULL ;
192
-
193
- printk (KERN_WARNING PREFIX "Deprecated procfs I/F for AC is loaded,"
194
- " please retry with CONFIG_ACPI_PROCFS_POWER cleared\n" );
195
- if (!acpi_device_dir (ac -> device )) {
196
- acpi_device_dir (ac -> device ) =
197
- proc_mkdir (acpi_device_bid (ac -> device ), acpi_ac_dir );
198
- if (!acpi_device_dir (ac -> device ))
199
- return - ENODEV ;
200
- }
201
-
202
- /* 'state' [R] */
203
- entry = proc_create_single_data (ACPI_AC_FILE_STATE , S_IRUGO ,
204
- acpi_device_dir (ac -> device ), acpi_ac_seq_show , ac );
205
- if (!entry )
206
- return - ENODEV ;
207
- return 0 ;
208
- }
209
-
210
- static int acpi_ac_remove_fs (struct acpi_ac * ac )
211
- {
212
-
213
- if (acpi_device_dir (ac -> device )) {
214
- remove_proc_entry (ACPI_AC_FILE_STATE ,
215
- acpi_device_dir (ac -> device ));
216
- remove_proc_entry (acpi_device_bid (ac -> device ), acpi_ac_dir );
217
- acpi_device_dir (ac -> device ) = NULL ;
218
- }
219
-
220
- return 0 ;
221
- }
222
- #endif
223
-
224
143
/* --------------------------------------------------------------------------
225
144
Driver Model
226
145
-------------------------------------------------------------------------- */
@@ -348,11 +267,6 @@ static int acpi_ac_add(struct acpi_device *device)
348
267
psy_cfg .drv_data = ac ;
349
268
350
269
ac -> charger_desc .name = acpi_device_bid (device );
351
- #ifdef CONFIG_ACPI_PROCFS_POWER
352
- result = acpi_ac_add_fs (ac );
353
- if (result )
354
- goto end ;
355
- #endif
356
270
ac -> charger_desc .type = POWER_SUPPLY_TYPE_MAINS ;
357
271
ac -> charger_desc .properties = ac_props ;
358
272
ac -> charger_desc .num_properties = ARRAY_SIZE (ac_props );
@@ -372,9 +286,6 @@ static int acpi_ac_add(struct acpi_device *device)
372
286
register_acpi_notifier (& ac -> battery_nb );
373
287
end :
374
288
if (result ) {
375
- #ifdef CONFIG_ACPI_PROCFS_POWER
376
- acpi_ac_remove_fs (ac );
377
- #endif
378
289
kfree (ac );
379
290
}
380
291
@@ -418,10 +329,6 @@ static int acpi_ac_remove(struct acpi_device *device)
418
329
power_supply_unregister (ac -> charger );
419
330
unregister_acpi_notifier (& ac -> battery_nb );
420
331
421
- #ifdef CONFIG_ACPI_PROCFS_POWER
422
- acpi_ac_remove_fs (ac );
423
- #endif
424
-
425
332
kfree (ac );
426
333
427
334
return 0 ;
@@ -447,18 +354,8 @@ static int __init acpi_ac_init(void)
447
354
}
448
355
}
449
356
450
- #ifdef CONFIG_ACPI_PROCFS_POWER
451
- acpi_ac_dir = acpi_lock_ac_dir ();
452
- if (!acpi_ac_dir )
453
- return - ENODEV ;
454
- #endif
455
-
456
-
457
357
result = acpi_bus_register_driver (& acpi_ac_driver );
458
358
if (result < 0 ) {
459
- #ifdef CONFIG_ACPI_PROCFS_POWER
460
- acpi_unlock_ac_dir (acpi_ac_dir );
461
- #endif
462
359
return - ENODEV ;
463
360
}
464
361
@@ -468,9 +365,6 @@ static int __init acpi_ac_init(void)
468
365
static void __exit acpi_ac_exit (void )
469
366
{
470
367
acpi_bus_unregister_driver (& acpi_ac_driver );
471
- #ifdef CONFIG_ACPI_PROCFS_POWER
472
- acpi_unlock_ac_dir (acpi_ac_dir );
473
- #endif
474
368
}
475
369
module_init (acpi_ac_init );
476
370
module_exit (acpi_ac_exit );
0 commit comments