aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2010-07-14 22:46:38 -0400
committerLen Brown <len.brown@intel.com>2010-08-15 00:28:26 -0400
commit06af7eb043c02822072cea862fce1b7c74115e8f (patch)
tree43af890ec5c9f6843cd12cc11e5b38f89f05b98e /drivers/acpi
parent47f5c892b06797336a34f1096b4b617623aa1960 (diff)
ACPI power_resource: remove unused procfs I/F
Remove unused ACPI power procfs I/F. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/power.c128
1 files changed, 1 insertions, 127 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index f74d3b31e5c9..4fe5018fd6ab 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -40,8 +40,6 @@
40#include <linux/init.h> 40#include <linux/init.h>
41#include <linux/types.h> 41#include <linux/types.h>
42#include <linux/slab.h> 42#include <linux/slab.h>
43#include <linux/proc_fs.h>
44#include <linux/seq_file.h>
45#include <acpi/acpi_bus.h> 43#include <acpi/acpi_bus.h>
46#include <acpi/acpi_drivers.h> 44#include <acpi/acpi_drivers.h>
47#include "sleep.h" 45#include "sleep.h"
@@ -64,7 +62,6 @@ module_param_named(power_nocheck, acpi_power_nocheck, bool, 000);
64static int acpi_power_add(struct acpi_device *device); 62static int acpi_power_add(struct acpi_device *device);
65static int acpi_power_remove(struct acpi_device *device, int type); 63static int acpi_power_remove(struct acpi_device *device, int type);
66static int acpi_power_resume(struct acpi_device *device); 64static int acpi_power_resume(struct acpi_device *device);
67static int acpi_power_open_fs(struct inode *inode, struct file *file);
68 65
69static const struct acpi_device_id power_device_ids[] = { 66static const struct acpi_device_id power_device_ids[] = {
70 {ACPI_POWER_HID, 0}, 67 {ACPI_POWER_HID, 0},
@@ -99,14 +96,6 @@ struct acpi_power_resource {
99 96
100static struct list_head acpi_power_resource_list; 97static struct list_head acpi_power_resource_list;
101 98
102static const struct file_operations acpi_power_fops = {
103 .owner = THIS_MODULE,
104 .open = acpi_power_open_fs,
105 .read = seq_read,
106 .llseek = seq_lseek,
107 .release = single_release,
108};
109
110/* -------------------------------------------------------------------------- 99/* --------------------------------------------------------------------------
111 Power Resource Management 100 Power Resource Management
112 -------------------------------------------------------------------------- */ 101 -------------------------------------------------------------------------- */
@@ -542,102 +531,6 @@ int acpi_power_transition(struct acpi_device *device, int state)
542} 531}
543 532
544/* -------------------------------------------------------------------------- 533/* --------------------------------------------------------------------------
545 FS Interface (/proc)
546 -------------------------------------------------------------------------- */
547
548static struct proc_dir_entry *acpi_power_dir;
549
550static int acpi_power_seq_show(struct seq_file *seq, void *offset)
551{
552 int count = 0;
553 int result = 0, state;
554 struct acpi_power_resource *resource = NULL;
555 struct list_head *node, *next;
556 struct acpi_power_reference *ref;
557
558
559 resource = seq->private;
560
561 if (!resource)
562 goto end;
563
564 result = acpi_power_get_state(resource->device->handle, &state);
565 if (result)
566 goto end;
567
568 seq_puts(seq, "state: ");
569 switch (state) {
570 case ACPI_POWER_RESOURCE_STATE_ON:
571 seq_puts(seq, "on\n");
572 break;
573 case ACPI_POWER_RESOURCE_STATE_OFF:
574 seq_puts(seq, "off\n");
575 break;
576 default:
577 seq_puts(seq, "unknown\n");
578 break;
579 }
580
581 mutex_lock(&resource->resource_lock);
582 list_for_each_safe(node, next, &resource->reference) {
583 ref = container_of(node, struct acpi_power_reference, node);
584 count++;
585 }
586 mutex_unlock(&resource->resource_lock);
587
588 seq_printf(seq, "system level: S%d\n"
589 "order: %d\n"
590 "reference count: %d\n",
591 resource->system_level,
592 resource->order, count);
593
594 end:
595 return 0;
596}
597
598static int acpi_power_open_fs(struct inode *inode, struct file *file)
599{
600 return single_open(file, acpi_power_seq_show, PDE(inode)->data);
601}
602
603static int acpi_power_add_fs(struct acpi_device *device)
604{
605 struct proc_dir_entry *entry = NULL;
606
607
608 if (!device)
609 return -EINVAL;
610
611 if (!acpi_device_dir(device)) {
612 acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
613 acpi_power_dir);
614 if (!acpi_device_dir(device))
615 return -ENODEV;
616 }
617
618 /* 'status' [R] */
619 entry = proc_create_data(ACPI_POWER_FILE_STATUS,
620 S_IRUGO, acpi_device_dir(device),
621 &acpi_power_fops, acpi_driver_data(device));
622 if (!entry)
623 return -EIO;
624 return 0;
625}
626
627static int acpi_power_remove_fs(struct acpi_device *device)
628{
629
630 if (acpi_device_dir(device)) {
631 remove_proc_entry(ACPI_POWER_FILE_STATUS,
632 acpi_device_dir(device));
633 remove_proc_entry(acpi_device_bid(device), acpi_power_dir);
634 acpi_device_dir(device) = NULL;
635 }
636
637 return 0;
638}
639
640/* --------------------------------------------------------------------------
641 Driver Interface 534 Driver Interface
642 -------------------------------------------------------------------------- */ 535 -------------------------------------------------------------------------- */
643 536
@@ -690,10 +583,6 @@ static int acpi_power_add(struct acpi_device *device)
690 break; 583 break;
691 } 584 }
692 585
693 result = acpi_power_add_fs(device);
694 if (result)
695 goto end;
696
697 printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), 586 printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device),
698 acpi_device_bid(device), state ? "on" : "off"); 587 acpi_device_bid(device), state ? "on" : "off");
699 588
@@ -715,8 +604,6 @@ static int acpi_power_remove(struct acpi_device *device, int type)
715 604
716 resource = acpi_driver_data(device); 605 resource = acpi_driver_data(device);
717 606
718 acpi_power_remove_fs(device);
719
720 mutex_lock(&resource->resource_lock); 607 mutex_lock(&resource->resource_lock);
721 list_for_each_safe(node, next, &resource->reference) { 608 list_for_each_safe(node, next, &resource->reference) {
722 struct acpi_power_reference *ref = container_of(node, struct acpi_power_reference, node); 609 struct acpi_power_reference *ref = container_of(node, struct acpi_power_reference, node);
@@ -760,19 +647,6 @@ static int acpi_power_resume(struct acpi_device *device)
760 647
761int __init acpi_power_init(void) 648int __init acpi_power_init(void)
762{ 649{
763 int result = 0;
764
765 INIT_LIST_HEAD(&acpi_power_resource_list); 650 INIT_LIST_HEAD(&acpi_power_resource_list);
766 651 return acpi_bus_register_driver(&acpi_power_driver);
767 acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir);
768 if (!acpi_power_dir)
769 return -ENODEV;
770
771 result = acpi_bus_register_driver(&acpi_power_driver);
772 if (result < 0) {
773 remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir);
774 return -ENODEV;
775 }
776
777 return 0;
778} 652}