diff options
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 40 | ||||
-rw-r--r-- | drivers/acpi/ec.c | 118 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 219 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 5 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 2 |
5 files changed, 153 insertions, 231 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index 80eacbe157e2..28ccdbc05ac8 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -53,7 +53,6 @@ MODULE_LICENSE("GPL"); | |||
53 | 53 | ||
54 | static int acpi_memory_device_add(struct acpi_device *device); | 54 | static int acpi_memory_device_add(struct acpi_device *device); |
55 | static int acpi_memory_device_remove(struct acpi_device *device, int type); | 55 | static int acpi_memory_device_remove(struct acpi_device *device, int type); |
56 | static int acpi_memory_device_start(struct acpi_device *device); | ||
57 | 56 | ||
58 | static const struct acpi_device_id memory_device_ids[] = { | 57 | static const struct acpi_device_id memory_device_ids[] = { |
59 | {ACPI_MEMORY_DEVICE_HID, 0}, | 58 | {ACPI_MEMORY_DEVICE_HID, 0}, |
@@ -68,7 +67,6 @@ static struct acpi_driver acpi_memory_device_driver = { | |||
68 | .ops = { | 67 | .ops = { |
69 | .add = acpi_memory_device_add, | 68 | .add = acpi_memory_device_add, |
70 | .remove = acpi_memory_device_remove, | 69 | .remove = acpi_memory_device_remove, |
71 | .start = acpi_memory_device_start, | ||
72 | }, | 70 | }, |
73 | }; | 71 | }; |
74 | 72 | ||
@@ -431,28 +429,6 @@ static int acpi_memory_device_add(struct acpi_device *device) | |||
431 | 429 | ||
432 | printk(KERN_DEBUG "%s \n", acpi_device_name(device)); | 430 | printk(KERN_DEBUG "%s \n", acpi_device_name(device)); |
433 | 431 | ||
434 | return result; | ||
435 | } | ||
436 | |||
437 | static int acpi_memory_device_remove(struct acpi_device *device, int type) | ||
438 | { | ||
439 | struct acpi_memory_device *mem_device = NULL; | ||
440 | |||
441 | |||
442 | if (!device || !acpi_driver_data(device)) | ||
443 | return -EINVAL; | ||
444 | |||
445 | mem_device = acpi_driver_data(device); | ||
446 | kfree(mem_device); | ||
447 | |||
448 | return 0; | ||
449 | } | ||
450 | |||
451 | static int acpi_memory_device_start (struct acpi_device *device) | ||
452 | { | ||
453 | struct acpi_memory_device *mem_device; | ||
454 | int result = 0; | ||
455 | |||
456 | /* | 432 | /* |
457 | * Early boot code has recognized memory area by EFI/E820. | 433 | * Early boot code has recognized memory area by EFI/E820. |
458 | * If DSDT shows these memory devices on boot, hotplug is not necessary | 434 | * If DSDT shows these memory devices on boot, hotplug is not necessary |
@@ -462,8 +438,6 @@ static int acpi_memory_device_start (struct acpi_device *device) | |||
462 | if (!acpi_hotmem_initialized) | 438 | if (!acpi_hotmem_initialized) |
463 | return 0; | 439 | return 0; |
464 | 440 | ||
465 | mem_device = acpi_driver_data(device); | ||
466 | |||
467 | if (!acpi_memory_check_device(mem_device)) { | 441 | if (!acpi_memory_check_device(mem_device)) { |
468 | /* call add_memory func */ | 442 | /* call add_memory func */ |
469 | result = acpi_memory_enable_device(mem_device); | 443 | result = acpi_memory_enable_device(mem_device); |
@@ -474,6 +448,20 @@ static int acpi_memory_device_start (struct acpi_device *device) | |||
474 | return result; | 448 | return result; |
475 | } | 449 | } |
476 | 450 | ||
451 | static int acpi_memory_device_remove(struct acpi_device *device, int type) | ||
452 | { | ||
453 | struct acpi_memory_device *mem_device = NULL; | ||
454 | |||
455 | |||
456 | if (!device || !acpi_driver_data(device)) | ||
457 | return -EINVAL; | ||
458 | |||
459 | mem_device = acpi_driver_data(device); | ||
460 | kfree(mem_device); | ||
461 | |||
462 | return 0; | ||
463 | } | ||
464 | |||
477 | /* | 465 | /* |
478 | * Helper function to check for memory device | 466 | * Helper function to check for memory device |
479 | */ | 467 | */ |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 5180f0f1dd02..f28619d658f7 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
@@ -787,6 +787,42 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) | |||
787 | return AE_CTRL_TERMINATE; | 787 | return AE_CTRL_TERMINATE; |
788 | } | 788 | } |
789 | 789 | ||
790 | static int ec_install_handlers(struct acpi_ec *ec) | ||
791 | { | ||
792 | acpi_status status; | ||
793 | if (test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags)) | ||
794 | return 0; | ||
795 | status = acpi_install_gpe_handler(NULL, ec->gpe, | ||
796 | ACPI_GPE_EDGE_TRIGGERED, | ||
797 | &acpi_ec_gpe_handler, ec); | ||
798 | if (ACPI_FAILURE(status)) | ||
799 | return -ENODEV; | ||
800 | acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); | ||
801 | acpi_enable_gpe(NULL, ec->gpe); | ||
802 | status = acpi_install_address_space_handler(ec->handle, | ||
803 | ACPI_ADR_SPACE_EC, | ||
804 | &acpi_ec_space_handler, | ||
805 | NULL, ec); | ||
806 | if (ACPI_FAILURE(status)) { | ||
807 | if (status == AE_NOT_FOUND) { | ||
808 | /* | ||
809 | * Maybe OS fails in evaluating the _REG object. | ||
810 | * The AE_NOT_FOUND error will be ignored and OS | ||
811 | * continue to initialize EC. | ||
812 | */ | ||
813 | printk(KERN_ERR "Fail in evaluating the _REG object" | ||
814 | " of EC device. Broken bios is suspected.\n"); | ||
815 | } else { | ||
816 | acpi_remove_gpe_handler(NULL, ec->gpe, | ||
817 | &acpi_ec_gpe_handler); | ||
818 | return -ENODEV; | ||
819 | } | ||
820 | } | ||
821 | |||
822 | set_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags); | ||
823 | return 0; | ||
824 | } | ||
825 | |||
790 | static void ec_remove_handlers(struct acpi_ec *ec) | 826 | static void ec_remove_handlers(struct acpi_ec *ec) |
791 | { | 827 | { |
792 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, | 828 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, |
@@ -801,9 +837,8 @@ static void ec_remove_handlers(struct acpi_ec *ec) | |||
801 | static int acpi_ec_add(struct acpi_device *device) | 837 | static int acpi_ec_add(struct acpi_device *device) |
802 | { | 838 | { |
803 | struct acpi_ec *ec = NULL; | 839 | struct acpi_ec *ec = NULL; |
840 | int ret; | ||
804 | 841 | ||
805 | if (!device) | ||
806 | return -EINVAL; | ||
807 | strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); | 842 | strcpy(acpi_device_name(device), ACPI_EC_DEVICE_NAME); |
808 | strcpy(acpi_device_class(device), ACPI_EC_CLASS); | 843 | strcpy(acpi_device_class(device), ACPI_EC_CLASS); |
809 | 844 | ||
@@ -838,7 +873,12 @@ static int acpi_ec_add(struct acpi_device *device) | |||
838 | ec->gpe, ec->command_addr, ec->data_addr); | 873 | ec->gpe, ec->command_addr, ec->data_addr); |
839 | pr_info(PREFIX "driver started in %s mode\n", | 874 | pr_info(PREFIX "driver started in %s mode\n", |
840 | (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))?"interrupt":"poll"); | 875 | (test_bit(EC_FLAGS_GPE_MODE, &ec->flags))?"interrupt":"poll"); |
841 | return 0; | 876 | |
877 | ret = ec_install_handlers(ec); | ||
878 | |||
879 | /* EC is fully operational, allow queries */ | ||
880 | clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); | ||
881 | return ret; | ||
842 | } | 882 | } |
843 | 883 | ||
844 | static int acpi_ec_remove(struct acpi_device *device, int type) | 884 | static int acpi_ec_remove(struct acpi_device *device, int type) |
@@ -850,6 +890,7 @@ static int acpi_ec_remove(struct acpi_device *device, int type) | |||
850 | return -EINVAL; | 890 | return -EINVAL; |
851 | 891 | ||
852 | ec = acpi_driver_data(device); | 892 | ec = acpi_driver_data(device); |
893 | ec_remove_handlers(ec); | ||
853 | mutex_lock(&ec->lock); | 894 | mutex_lock(&ec->lock); |
854 | list_for_each_entry_safe(handler, tmp, &ec->list, node) { | 895 | list_for_each_entry_safe(handler, tmp, &ec->list, node) { |
855 | list_del(&handler->node); | 896 | list_del(&handler->node); |
@@ -887,75 +928,6 @@ ec_parse_io_ports(struct acpi_resource *resource, void *context) | |||
887 | return AE_OK; | 928 | return AE_OK; |
888 | } | 929 | } |
889 | 930 | ||
890 | static int ec_install_handlers(struct acpi_ec *ec) | ||
891 | { | ||
892 | acpi_status status; | ||
893 | if (test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags)) | ||
894 | return 0; | ||
895 | status = acpi_install_gpe_handler(NULL, ec->gpe, | ||
896 | ACPI_GPE_EDGE_TRIGGERED, | ||
897 | &acpi_ec_gpe_handler, ec); | ||
898 | if (ACPI_FAILURE(status)) | ||
899 | return -ENODEV; | ||
900 | acpi_set_gpe_type(NULL, ec->gpe, ACPI_GPE_TYPE_RUNTIME); | ||
901 | acpi_enable_gpe(NULL, ec->gpe); | ||
902 | status = acpi_install_address_space_handler(ec->handle, | ||
903 | ACPI_ADR_SPACE_EC, | ||
904 | &acpi_ec_space_handler, | ||
905 | NULL, ec); | ||
906 | if (ACPI_FAILURE(status)) { | ||
907 | if (status == AE_NOT_FOUND) { | ||
908 | /* | ||
909 | * Maybe OS fails in evaluating the _REG object. | ||
910 | * The AE_NOT_FOUND error will be ignored and OS | ||
911 | * continue to initialize EC. | ||
912 | */ | ||
913 | printk(KERN_ERR "Fail in evaluating the _REG object" | ||
914 | " of EC device. Broken bios is suspected.\n"); | ||
915 | } else { | ||
916 | acpi_remove_gpe_handler(NULL, ec->gpe, | ||
917 | &acpi_ec_gpe_handler); | ||
918 | return -ENODEV; | ||
919 | } | ||
920 | } | ||
921 | |||
922 | set_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags); | ||
923 | return 0; | ||
924 | } | ||
925 | |||
926 | static int acpi_ec_start(struct acpi_device *device) | ||
927 | { | ||
928 | struct acpi_ec *ec; | ||
929 | int ret = 0; | ||
930 | |||
931 | if (!device) | ||
932 | return -EINVAL; | ||
933 | |||
934 | ec = acpi_driver_data(device); | ||
935 | |||
936 | if (!ec) | ||
937 | return -EINVAL; | ||
938 | |||
939 | ret = ec_install_handlers(ec); | ||
940 | |||
941 | /* EC is fully operational, allow queries */ | ||
942 | clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); | ||
943 | return ret; | ||
944 | } | ||
945 | |||
946 | static int acpi_ec_stop(struct acpi_device *device, int type) | ||
947 | { | ||
948 | struct acpi_ec *ec; | ||
949 | if (!device) | ||
950 | return -EINVAL; | ||
951 | ec = acpi_driver_data(device); | ||
952 | if (!ec) | ||
953 | return -EINVAL; | ||
954 | ec_remove_handlers(ec); | ||
955 | |||
956 | return 0; | ||
957 | } | ||
958 | |||
959 | int __init acpi_boot_ec_enable(void) | 931 | int __init acpi_boot_ec_enable(void) |
960 | { | 932 | { |
961 | if (!boot_ec || test_bit(EC_FLAGS_HANDLERS_INSTALLED, &boot_ec->flags)) | 933 | if (!boot_ec || test_bit(EC_FLAGS_HANDLERS_INSTALLED, &boot_ec->flags)) |
@@ -1076,8 +1048,6 @@ static struct acpi_driver acpi_ec_driver = { | |||
1076 | .ops = { | 1048 | .ops = { |
1077 | .add = acpi_ec_add, | 1049 | .add = acpi_ec_add, |
1078 | .remove = acpi_ec_remove, | 1050 | .remove = acpi_ec_remove, |
1079 | .start = acpi_ec_start, | ||
1080 | .stop = acpi_ec_stop, | ||
1081 | .suspend = acpi_ec_suspend, | 1051 | .suspend = acpi_ec_suspend, |
1082 | .resume = acpi_ec_resume, | 1052 | .resume = acpi_ec_resume, |
1083 | }, | 1053 | }, |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index b4a1ab297e7b..b972107a1ef2 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -81,7 +81,6 @@ MODULE_DESCRIPTION("ACPI Processor Driver"); | |||
81 | MODULE_LICENSE("GPL"); | 81 | MODULE_LICENSE("GPL"); |
82 | 82 | ||
83 | static int acpi_processor_add(struct acpi_device *device); | 83 | static int acpi_processor_add(struct acpi_device *device); |
84 | static int acpi_processor_start(struct acpi_device *device); | ||
85 | static int acpi_processor_remove(struct acpi_device *device, int type); | 84 | static int acpi_processor_remove(struct acpi_device *device, int type); |
86 | static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); | 85 | static int acpi_processor_info_open_fs(struct inode *inode, struct file *file); |
87 | static void acpi_processor_notify(struct acpi_device *device, u32 event); | 86 | static void acpi_processor_notify(struct acpi_device *device, u32 event); |
@@ -103,7 +102,6 @@ static struct acpi_driver acpi_processor_driver = { | |||
103 | .ops = { | 102 | .ops = { |
104 | .add = acpi_processor_add, | 103 | .add = acpi_processor_add, |
105 | .remove = acpi_processor_remove, | 104 | .remove = acpi_processor_remove, |
106 | .start = acpi_processor_start, | ||
107 | .suspend = acpi_processor_suspend, | 105 | .suspend = acpi_processor_suspend, |
108 | .resume = acpi_processor_resume, | 106 | .resume = acpi_processor_resume, |
109 | .notify = acpi_processor_notify, | 107 | .notify = acpi_processor_notify, |
@@ -700,92 +698,6 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
700 | 698 | ||
701 | static DEFINE_PER_CPU(void *, processor_device_array); | 699 | static DEFINE_PER_CPU(void *, processor_device_array); |
702 | 700 | ||
703 | static int __cpuinit acpi_processor_start(struct acpi_device *device) | ||
704 | { | ||
705 | int result = 0; | ||
706 | struct acpi_processor *pr; | ||
707 | struct sys_device *sysdev; | ||
708 | |||
709 | pr = acpi_driver_data(device); | ||
710 | |||
711 | result = acpi_processor_get_info(device); | ||
712 | if (result) { | ||
713 | /* Processor is physically not present */ | ||
714 | return 0; | ||
715 | } | ||
716 | |||
717 | BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0)); | ||
718 | |||
719 | /* | ||
720 | * Buggy BIOS check | ||
721 | * ACPI id of processors can be reported wrongly by the BIOS. | ||
722 | * Don't trust it blindly | ||
723 | */ | ||
724 | if (per_cpu(processor_device_array, pr->id) != NULL && | ||
725 | per_cpu(processor_device_array, pr->id) != device) { | ||
726 | printk(KERN_WARNING "BIOS reported wrong ACPI id " | ||
727 | "for the processor\n"); | ||
728 | return -ENODEV; | ||
729 | } | ||
730 | per_cpu(processor_device_array, pr->id) = device; | ||
731 | |||
732 | per_cpu(processors, pr->id) = pr; | ||
733 | |||
734 | result = acpi_processor_add_fs(device); | ||
735 | if (result) | ||
736 | goto end; | ||
737 | |||
738 | sysdev = get_cpu_sysdev(pr->id); | ||
739 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) | ||
740 | return -EFAULT; | ||
741 | |||
742 | /* _PDC call should be done before doing anything else (if reqd.). */ | ||
743 | arch_acpi_processor_init_pdc(pr); | ||
744 | acpi_processor_set_pdc(pr); | ||
745 | arch_acpi_processor_cleanup_pdc(pr); | ||
746 | |||
747 | #ifdef CONFIG_CPU_FREQ | ||
748 | acpi_processor_ppc_has_changed(pr); | ||
749 | #endif | ||
750 | acpi_processor_get_throttling_info(pr); | ||
751 | acpi_processor_get_limit_info(pr); | ||
752 | |||
753 | |||
754 | acpi_processor_power_init(pr, device); | ||
755 | |||
756 | pr->cdev = thermal_cooling_device_register("Processor", device, | ||
757 | &processor_cooling_ops); | ||
758 | if (IS_ERR(pr->cdev)) { | ||
759 | result = PTR_ERR(pr->cdev); | ||
760 | goto end; | ||
761 | } | ||
762 | |||
763 | dev_info(&device->dev, "registered as cooling_device%d\n", | ||
764 | pr->cdev->id); | ||
765 | |||
766 | result = sysfs_create_link(&device->dev.kobj, | ||
767 | &pr->cdev->device.kobj, | ||
768 | "thermal_cooling"); | ||
769 | if (result) | ||
770 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | ||
771 | result = sysfs_create_link(&pr->cdev->device.kobj, | ||
772 | &device->dev.kobj, | ||
773 | "device"); | ||
774 | if (result) | ||
775 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | ||
776 | |||
777 | if (pr->flags.throttling) { | ||
778 | printk(KERN_INFO PREFIX "%s [%s] (supports", | ||
779 | acpi_device_name(device), acpi_device_bid(device)); | ||
780 | printk(" %d throttling states", pr->throttling.state_count); | ||
781 | printk(")\n"); | ||
782 | } | ||
783 | |||
784 | end: | ||
785 | |||
786 | return result; | ||
787 | } | ||
788 | |||
789 | static void acpi_processor_notify(struct acpi_device *device, u32 event) | 701 | static void acpi_processor_notify(struct acpi_device *device, u32 event) |
790 | { | 702 | { |
791 | struct acpi_processor *pr = acpi_driver_data(device); | 703 | struct acpi_processor *pr = acpi_driver_data(device); |
@@ -848,10 +760,8 @@ static struct notifier_block acpi_cpu_notifier = | |||
848 | static int acpi_processor_add(struct acpi_device *device) | 760 | static int acpi_processor_add(struct acpi_device *device) |
849 | { | 761 | { |
850 | struct acpi_processor *pr = NULL; | 762 | struct acpi_processor *pr = NULL; |
851 | 763 | int result = 0; | |
852 | 764 | struct sys_device *sysdev; | |
853 | if (!device) | ||
854 | return -EINVAL; | ||
855 | 765 | ||
856 | pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); | 766 | pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); |
857 | if (!pr) | 767 | if (!pr) |
@@ -867,7 +777,100 @@ static int acpi_processor_add(struct acpi_device *device) | |||
867 | strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); | 777 | strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS); |
868 | device->driver_data = pr; | 778 | device->driver_data = pr; |
869 | 779 | ||
780 | result = acpi_processor_get_info(device); | ||
781 | if (result) { | ||
782 | /* Processor is physically not present */ | ||
783 | return 0; | ||
784 | } | ||
785 | |||
786 | BUG_ON((pr->id >= nr_cpu_ids) || (pr->id < 0)); | ||
787 | |||
788 | /* | ||
789 | * Buggy BIOS check | ||
790 | * ACPI id of processors can be reported wrongly by the BIOS. | ||
791 | * Don't trust it blindly | ||
792 | */ | ||
793 | if (per_cpu(processor_device_array, pr->id) != NULL && | ||
794 | per_cpu(processor_device_array, pr->id) != device) { | ||
795 | printk(KERN_WARNING "BIOS reported wrong ACPI id " | ||
796 | "for the processor\n"); | ||
797 | result = -ENODEV; | ||
798 | goto err_free_cpumask; | ||
799 | } | ||
800 | per_cpu(processor_device_array, pr->id) = device; | ||
801 | |||
802 | per_cpu(processors, pr->id) = pr; | ||
803 | |||
804 | result = acpi_processor_add_fs(device); | ||
805 | if (result) | ||
806 | goto err_free_cpumask; | ||
807 | |||
808 | sysdev = get_cpu_sysdev(pr->id); | ||
809 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { | ||
810 | result = -EFAULT; | ||
811 | goto err_remove_fs; | ||
812 | } | ||
813 | |||
814 | /* _PDC call should be done before doing anything else (if reqd.). */ | ||
815 | arch_acpi_processor_init_pdc(pr); | ||
816 | acpi_processor_set_pdc(pr); | ||
817 | arch_acpi_processor_cleanup_pdc(pr); | ||
818 | |||
819 | #ifdef CONFIG_CPU_FREQ | ||
820 | acpi_processor_ppc_has_changed(pr); | ||
821 | #endif | ||
822 | acpi_processor_get_throttling_info(pr); | ||
823 | acpi_processor_get_limit_info(pr); | ||
824 | |||
825 | |||
826 | acpi_processor_power_init(pr, device); | ||
827 | |||
828 | pr->cdev = thermal_cooling_device_register("Processor", device, | ||
829 | &processor_cooling_ops); | ||
830 | if (IS_ERR(pr->cdev)) { | ||
831 | result = PTR_ERR(pr->cdev); | ||
832 | goto err_power_exit; | ||
833 | } | ||
834 | |||
835 | dev_info(&device->dev, "registered as cooling_device%d\n", | ||
836 | pr->cdev->id); | ||
837 | |||
838 | result = sysfs_create_link(&device->dev.kobj, | ||
839 | &pr->cdev->device.kobj, | ||
840 | "thermal_cooling"); | ||
841 | if (result) { | ||
842 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | ||
843 | goto err_thermal_unregister; | ||
844 | } | ||
845 | result = sysfs_create_link(&pr->cdev->device.kobj, | ||
846 | &device->dev.kobj, | ||
847 | "device"); | ||
848 | if (result) { | ||
849 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | ||
850 | goto err_remove_sysfs; | ||
851 | } | ||
852 | |||
853 | if (pr->flags.throttling) { | ||
854 | printk(KERN_INFO PREFIX "%s [%s] (supports", | ||
855 | acpi_device_name(device), acpi_device_bid(device)); | ||
856 | printk(" %d throttling states", pr->throttling.state_count); | ||
857 | printk(")\n"); | ||
858 | } | ||
859 | |||
870 | return 0; | 860 | return 0; |
861 | |||
862 | err_remove_sysfs: | ||
863 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); | ||
864 | err_thermal_unregister: | ||
865 | thermal_cooling_device_unregister(pr->cdev); | ||
866 | err_power_exit: | ||
867 | acpi_processor_power_exit(pr, device); | ||
868 | err_remove_fs: | ||
869 | acpi_processor_remove_fs(device); | ||
870 | err_free_cpumask: | ||
871 | free_cpumask_var(pr->throttling.shared_cpu_map); | ||
872 | |||
873 | return result; | ||
871 | } | 874 | } |
872 | 875 | ||
873 | static int acpi_processor_remove(struct acpi_device *device, int type) | 876 | static int acpi_processor_remove(struct acpi_device *device, int type) |
@@ -944,7 +947,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) | |||
944 | { | 947 | { |
945 | acpi_handle phandle; | 948 | acpi_handle phandle; |
946 | struct acpi_device *pdev; | 949 | struct acpi_device *pdev; |
947 | struct acpi_processor *pr; | ||
948 | 950 | ||
949 | 951 | ||
950 | if (acpi_get_parent(handle, &phandle)) { | 952 | if (acpi_get_parent(handle, &phandle)) { |
@@ -959,15 +961,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) | |||
959 | return -ENODEV; | 961 | return -ENODEV; |
960 | } | 962 | } |
961 | 963 | ||
962 | acpi_bus_start(*device); | ||
963 | |||
964 | pr = acpi_driver_data(*device); | ||
965 | if (!pr) | ||
966 | return -ENODEV; | ||
967 | |||
968 | if ((pr->id >= 0) && (pr->id < nr_cpu_ids)) { | ||
969 | kobject_uevent(&(*device)->dev.kobj, KOBJ_ONLINE); | ||
970 | } | ||
971 | return 0; | 964 | return 0; |
972 | } | 965 | } |
973 | 966 | ||
@@ -997,25 +990,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle, | |||
997 | "Unable to add the device\n"); | 990 | "Unable to add the device\n"); |
998 | break; | 991 | break; |
999 | } | 992 | } |
1000 | |||
1001 | pr = acpi_driver_data(device); | ||
1002 | if (!pr) { | ||
1003 | printk(KERN_ERR PREFIX "Driver data is NULL\n"); | ||
1004 | break; | ||
1005 | } | ||
1006 | |||
1007 | if (pr->id >= 0 && (pr->id < nr_cpu_ids)) { | ||
1008 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | ||
1009 | break; | ||
1010 | } | ||
1011 | |||
1012 | result = acpi_processor_start(device); | ||
1013 | if ((!result) && ((pr->id >= 0) && (pr->id < nr_cpu_ids))) { | ||
1014 | kobject_uevent(&device->dev.kobj, KOBJ_ONLINE); | ||
1015 | } else { | ||
1016 | printk(KERN_ERR PREFIX "Device [%s] failed to start\n", | ||
1017 | acpi_device_bid(device)); | ||
1018 | } | ||
1019 | break; | 993 | break; |
1020 | case ACPI_NOTIFY_EJECT_REQUEST: | 994 | case ACPI_NOTIFY_EJECT_REQUEST: |
1021 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 995 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
@@ -1032,9 +1006,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle, | |||
1032 | "Driver data is NULL, dropping EJECT\n"); | 1006 | "Driver data is NULL, dropping EJECT\n"); |
1033 | return; | 1007 | return; |
1034 | } | 1008 | } |
1035 | |||
1036 | if ((pr->id < nr_cpu_ids) && (cpu_present(pr->id))) | ||
1037 | kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE); | ||
1038 | break; | 1009 | break; |
1039 | default: | 1010 | default: |
1040 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 1011 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 297d8b94fbbc..7b90900b2118 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -430,9 +430,6 @@ static int acpi_device_probe(struct device * dev) | |||
430 | if (acpi_drv->ops.notify) { | 430 | if (acpi_drv->ops.notify) { |
431 | ret = acpi_device_install_notify_handler(acpi_dev); | 431 | ret = acpi_device_install_notify_handler(acpi_dev); |
432 | if (ret) { | 432 | if (ret) { |
433 | if (acpi_drv->ops.stop) | ||
434 | acpi_drv->ops.stop(acpi_dev, | ||
435 | acpi_dev->removal_type); | ||
436 | if (acpi_drv->ops.remove) | 433 | if (acpi_drv->ops.remove) |
437 | acpi_drv->ops.remove(acpi_dev, | 434 | acpi_drv->ops.remove(acpi_dev, |
438 | acpi_dev->removal_type); | 435 | acpi_dev->removal_type); |
@@ -456,8 +453,6 @@ static int acpi_device_remove(struct device * dev) | |||
456 | if (acpi_drv) { | 453 | if (acpi_drv) { |
457 | if (acpi_drv->ops.notify) | 454 | if (acpi_drv->ops.notify) |
458 | acpi_device_remove_notify_handler(acpi_dev); | 455 | acpi_device_remove_notify_handler(acpi_dev); |
459 | if (acpi_drv->ops.stop) | ||
460 | acpi_drv->ops.stop(acpi_dev, acpi_dev->removal_type); | ||
461 | if (acpi_drv->ops.remove) | 456 | if (acpi_drv->ops.remove) |
462 | acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type); | 457 | acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type); |
463 | } | 458 | } |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index af5905eca06f..89bbb2aeabbd 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -87,7 +87,6 @@ struct acpi_device; | |||
87 | typedef int (*acpi_op_add) (struct acpi_device * device); | 87 | typedef int (*acpi_op_add) (struct acpi_device * device); |
88 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); | 88 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); |
89 | typedef int (*acpi_op_start) (struct acpi_device * device); | 89 | typedef int (*acpi_op_start) (struct acpi_device * device); |
90 | typedef int (*acpi_op_stop) (struct acpi_device * device, int type); | ||
91 | typedef int (*acpi_op_suspend) (struct acpi_device * device, | 90 | typedef int (*acpi_op_suspend) (struct acpi_device * device, |
92 | pm_message_t state); | 91 | pm_message_t state); |
93 | typedef int (*acpi_op_resume) (struct acpi_device * device); | 92 | typedef int (*acpi_op_resume) (struct acpi_device * device); |
@@ -104,7 +103,6 @@ struct acpi_device_ops { | |||
104 | acpi_op_add add; | 103 | acpi_op_add add; |
105 | acpi_op_remove remove; | 104 | acpi_op_remove remove; |
106 | acpi_op_start start; | 105 | acpi_op_start start; |
107 | acpi_op_stop stop; | ||
108 | acpi_op_suspend suspend; | 106 | acpi_op_suspend suspend; |
109 | acpi_op_resume resume; | 107 | acpi_op_resume resume; |
110 | acpi_op_bind bind; | 108 | acpi_op_bind bind; |