1313#include <linux/types.h>
1414#include <linux/dmi.h>
1515#include <linux/delay.h>
16- #ifdef CONFIG_ACPI_PROCFS_POWER
17- #include <linux/proc_fs.h>
18- #include <linux/seq_file.h>
19- #endif
2016#include <linux/platform_device.h>
2117#include <linux/power_supply.h>
2218#include <linux/acpi.h>
@@ -66,12 +62,6 @@ static int acpi_ac_resume(struct device *dev);
6662#endif
6763static SIMPLE_DEV_PM_OPS (acpi_ac_pm , NULL, acpi_ac_resume ) ;
6864
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-
7565static int ac_sleep_before_get_state_ms ;
7666static int ac_check_pmic = 1 ;
7767
@@ -150,77 +140,6 @@ static enum power_supply_property ac_props[] = {
150140 POWER_SUPPLY_PROP_ONLINE ,
151141};
152142
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-
224143/* --------------------------------------------------------------------------
225144 Driver Model
226145 -------------------------------------------------------------------------- */
@@ -348,11 +267,6 @@ static int acpi_ac_add(struct acpi_device *device)
348267 psy_cfg .drv_data = ac ;
349268
350269 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
356270 ac -> charger_desc .type = POWER_SUPPLY_TYPE_MAINS ;
357271 ac -> charger_desc .properties = ac_props ;
358272 ac -> charger_desc .num_properties = ARRAY_SIZE (ac_props );
@@ -372,9 +286,6 @@ static int acpi_ac_add(struct acpi_device *device)
372286 register_acpi_notifier (& ac -> battery_nb );
373287end :
374288 if (result ) {
375- #ifdef CONFIG_ACPI_PROCFS_POWER
376- acpi_ac_remove_fs (ac );
377- #endif
378289 kfree (ac );
379290 }
380291
@@ -418,10 +329,6 @@ static int acpi_ac_remove(struct acpi_device *device)
418329 power_supply_unregister (ac -> charger );
419330 unregister_acpi_notifier (& ac -> battery_nb );
420331
421- #ifdef CONFIG_ACPI_PROCFS_POWER
422- acpi_ac_remove_fs (ac );
423- #endif
424-
425332 kfree (ac );
426333
427334 return 0 ;
@@ -447,18 +354,8 @@ static int __init acpi_ac_init(void)
447354 }
448355 }
449356
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-
457357 result = acpi_bus_register_driver (& acpi_ac_driver );
458358 if (result < 0 ) {
459- #ifdef CONFIG_ACPI_PROCFS_POWER
460- acpi_unlock_ac_dir (acpi_ac_dir );
461- #endif
462359 return - ENODEV ;
463360 }
464361
@@ -468,9 +365,6 @@ static int __init acpi_ac_init(void)
468365static void __exit acpi_ac_exit (void )
469366{
470367 acpi_bus_unregister_driver (& acpi_ac_driver );
471- #ifdef CONFIG_ACPI_PROCFS_POWER
472- acpi_unlock_ac_dir (acpi_ac_dir );
473- #endif
474368}
475369module_init (acpi_ac_init );
476370module_exit (acpi_ac_exit );
0 commit comments