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>

authored by Zhang Rui and committed by Len Brown 06af7eb0 47f5c892

+1 -127
+1 -127
drivers/acpi/power.c
··· 40 40 #include <linux/init.h> 41 41 #include <linux/types.h> 42 42 #include <linux/slab.h> 43 - #include <linux/proc_fs.h> 44 - #include <linux/seq_file.h> 45 43 #include <acpi/acpi_bus.h> 46 44 #include <acpi/acpi_drivers.h> 47 45 #include "sleep.h" ··· 62 64 static int acpi_power_add(struct acpi_device *device); 63 65 static int acpi_power_remove(struct acpi_device *device, int type); 64 66 static int acpi_power_resume(struct acpi_device *device); 65 - static int acpi_power_open_fs(struct inode *inode, struct file *file); 66 67 67 68 static const struct acpi_device_id power_device_ids[] = { 68 69 {ACPI_POWER_HID, 0}, ··· 95 98 }; 96 99 97 100 static struct list_head acpi_power_resource_list; 98 - 99 - static const struct file_operations acpi_power_fops = { 100 - .owner = THIS_MODULE, 101 - .open = acpi_power_open_fs, 102 - .read = seq_read, 103 - .llseek = seq_lseek, 104 - .release = single_release, 105 - }; 106 101 107 102 /* -------------------------------------------------------------------------- 108 103 Power Resource Management ··· 531 542 } 532 543 533 544 /* -------------------------------------------------------------------------- 534 - FS Interface (/proc) 535 - -------------------------------------------------------------------------- */ 536 - 537 - static struct proc_dir_entry *acpi_power_dir; 538 - 539 - static int acpi_power_seq_show(struct seq_file *seq, void *offset) 540 - { 541 - int count = 0; 542 - int result = 0, state; 543 - struct acpi_power_resource *resource = NULL; 544 - struct list_head *node, *next; 545 - struct acpi_power_reference *ref; 546 - 547 - 548 - resource = seq->private; 549 - 550 - if (!resource) 551 - goto end; 552 - 553 - result = acpi_power_get_state(resource->device->handle, &state); 554 - if (result) 555 - goto end; 556 - 557 - seq_puts(seq, "state: "); 558 - switch (state) { 559 - case ACPI_POWER_RESOURCE_STATE_ON: 560 - seq_puts(seq, "on\n"); 561 - break; 562 - case ACPI_POWER_RESOURCE_STATE_OFF: 563 - seq_puts(seq, "off\n"); 564 - break; 565 - default: 566 - seq_puts(seq, "unknown\n"); 567 - break; 568 - } 569 - 570 - mutex_lock(&resource->resource_lock); 571 - list_for_each_safe(node, next, &resource->reference) { 572 - ref = container_of(node, struct acpi_power_reference, node); 573 - count++; 574 - } 575 - mutex_unlock(&resource->resource_lock); 576 - 577 - seq_printf(seq, "system level: S%d\n" 578 - "order: %d\n" 579 - "reference count: %d\n", 580 - resource->system_level, 581 - resource->order, count); 582 - 583 - end: 584 - return 0; 585 - } 586 - 587 - static int acpi_power_open_fs(struct inode *inode, struct file *file) 588 - { 589 - return single_open(file, acpi_power_seq_show, PDE(inode)->data); 590 - } 591 - 592 - static int acpi_power_add_fs(struct acpi_device *device) 593 - { 594 - struct proc_dir_entry *entry = NULL; 595 - 596 - 597 - if (!device) 598 - return -EINVAL; 599 - 600 - if (!acpi_device_dir(device)) { 601 - acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), 602 - acpi_power_dir); 603 - if (!acpi_device_dir(device)) 604 - return -ENODEV; 605 - } 606 - 607 - /* 'status' [R] */ 608 - entry = proc_create_data(ACPI_POWER_FILE_STATUS, 609 - S_IRUGO, acpi_device_dir(device), 610 - &acpi_power_fops, acpi_driver_data(device)); 611 - if (!entry) 612 - return -EIO; 613 - return 0; 614 - } 615 - 616 - static int acpi_power_remove_fs(struct acpi_device *device) 617 - { 618 - 619 - if (acpi_device_dir(device)) { 620 - remove_proc_entry(ACPI_POWER_FILE_STATUS, 621 - acpi_device_dir(device)); 622 - remove_proc_entry(acpi_device_bid(device), acpi_power_dir); 623 - acpi_device_dir(device) = NULL; 624 - } 625 - 626 - return 0; 627 - } 628 - 629 - /* -------------------------------------------------------------------------- 630 545 Driver Interface 631 546 -------------------------------------------------------------------------- */ 632 547 ··· 583 690 break; 584 691 } 585 692 586 - result = acpi_power_add_fs(device); 587 - if (result) 588 - goto end; 589 - 590 693 printk(KERN_INFO PREFIX "%s [%s] (%s)\n", acpi_device_name(device), 591 694 acpi_device_bid(device), state ? "on" : "off"); 592 695 ··· 603 714 return -EINVAL; 604 715 605 716 resource = acpi_driver_data(device); 606 - 607 - acpi_power_remove_fs(device); 608 717 609 718 mutex_lock(&resource->resource_lock); 610 719 list_for_each_safe(node, next, &resource->reference) { ··· 647 760 648 761 int __init acpi_power_init(void) 649 762 { 650 - int result = 0; 651 - 652 763 INIT_LIST_HEAD(&acpi_power_resource_list); 653 - 654 - acpi_power_dir = proc_mkdir(ACPI_POWER_CLASS, acpi_root_dir); 655 - if (!acpi_power_dir) 656 - return -ENODEV; 657 - 658 - result = acpi_bus_register_driver(&acpi_power_driver); 659 - if (result < 0) { 660 - remove_proc_entry(ACPI_POWER_CLASS, acpi_root_dir); 661 - return -ENODEV; 662 - } 663 - 664 - return 0; 764 + return acpi_bus_register_driver(&acpi_power_driver); 665 765 }