diff options
Diffstat (limited to 'drivers/acpi/sbs.c')
-rw-r--r-- | drivers/acpi/sbs.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index e523245643ac..b6241eeb1132 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -521,19 +521,6 @@ acpi_sbs_add_fs(struct proc_dir_entry **dir, | |||
521 | return 0; | 521 | return 0; |
522 | } | 522 | } |
523 | 523 | ||
524 | static void | ||
525 | acpi_sbs_remove_fs(struct proc_dir_entry **dir, | ||
526 | struct proc_dir_entry *parent_dir) | ||
527 | { | ||
528 | if (*dir) { | ||
529 | remove_proc_entry(ACPI_SBS_FILE_INFO, *dir); | ||
530 | remove_proc_entry(ACPI_SBS_FILE_STATE, *dir); | ||
531 | remove_proc_entry(ACPI_SBS_FILE_ALARM, *dir); | ||
532 | remove_proc_entry((*dir)->name, parent_dir); | ||
533 | *dir = NULL; | ||
534 | } | ||
535 | } | ||
536 | |||
537 | /* Smart Battery Interface */ | 524 | /* Smart Battery Interface */ |
538 | static struct proc_dir_entry *acpi_battery_dir = NULL; | 525 | static struct proc_dir_entry *acpi_battery_dir = NULL; |
539 | 526 | ||
@@ -584,7 +571,7 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) | |||
584 | 571 | ||
585 | static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) | 572 | static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) |
586 | { | 573 | { |
587 | return single_open(file, acpi_battery_read_info, PDE(inode)->data); | 574 | return single_open(file, acpi_battery_read_info, PDE_DATA(inode)); |
588 | } | 575 | } |
589 | 576 | ||
590 | static int acpi_battery_read_state(struct seq_file *seq, void *offset) | 577 | static int acpi_battery_read_state(struct seq_file *seq, void *offset) |
@@ -623,7 +610,7 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) | |||
623 | 610 | ||
624 | static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) | 611 | static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) |
625 | { | 612 | { |
626 | return single_open(file, acpi_battery_read_state, PDE(inode)->data); | 613 | return single_open(file, acpi_battery_read_state, PDE_DATA(inode)); |
627 | } | 614 | } |
628 | 615 | ||
629 | static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) | 616 | static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) |
@@ -688,7 +675,7 @@ acpi_battery_write_alarm(struct file *file, const char __user * buffer, | |||
688 | 675 | ||
689 | static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) | 676 | static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) |
690 | { | 677 | { |
691 | return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); | 678 | return single_open(file, acpi_battery_read_alarm, PDE_DATA(inode)); |
692 | } | 679 | } |
693 | 680 | ||
694 | static const struct file_operations acpi_battery_info_fops = { | 681 | static const struct file_operations acpi_battery_info_fops = { |
@@ -736,7 +723,7 @@ static int acpi_ac_read_state(struct seq_file *seq, void *offset) | |||
736 | 723 | ||
737 | static int acpi_ac_state_open_fs(struct inode *inode, struct file *file) | 724 | static int acpi_ac_state_open_fs(struct inode *inode, struct file *file) |
738 | { | 725 | { |
739 | return single_open(file, acpi_ac_read_state, PDE(inode)->data); | 726 | return single_open(file, acpi_ac_read_state, PDE_DATA(inode)); |
740 | } | 727 | } |
741 | 728 | ||
742 | static const struct file_operations acpi_ac_state_fops = { | 729 | static const struct file_operations acpi_ac_state_fops = { |
@@ -836,8 +823,8 @@ static void acpi_battery_remove(struct acpi_sbs *sbs, int id) | |||
836 | power_supply_unregister(&battery->bat); | 823 | power_supply_unregister(&battery->bat); |
837 | } | 824 | } |
838 | #ifdef CONFIG_ACPI_PROCFS_POWER | 825 | #ifdef CONFIG_ACPI_PROCFS_POWER |
839 | if (battery->proc_entry) | 826 | proc_remove(battery->proc_entry); |
840 | acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir); | 827 | battery->proc_entry = NULL; |
841 | #endif | 828 | #endif |
842 | } | 829 | } |
843 | 830 | ||
@@ -873,8 +860,8 @@ static void acpi_charger_remove(struct acpi_sbs *sbs) | |||
873 | if (sbs->charger.dev) | 860 | if (sbs->charger.dev) |
874 | power_supply_unregister(&sbs->charger); | 861 | power_supply_unregister(&sbs->charger); |
875 | #ifdef CONFIG_ACPI_PROCFS_POWER | 862 | #ifdef CONFIG_ACPI_PROCFS_POWER |
876 | if (sbs->charger_entry) | 863 | proc_remove(sbs->charger_entry); |
877 | acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir); | 864 | sbs->charger_entry = NULL; |
878 | #endif | 865 | #endif |
879 | } | 866 | } |
880 | 867 | ||