Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI: Use syscore_ops instead of sysdev class and sysdev

ACPI uses a sysdev class and a sysdev for executing
irqrouter_resume() before turning on interrupts on the boot CPU.
However, since irqrouter_resume() ignores its argument, the entire
mechanism may be replaced with a struct syscore_ops object which
is considerably simpler.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Rafael J. Wysocki and committed by
Len Brown
c3146df2 4d3fbff2

+8 -22
+8 -22
drivers/acpi/pci_link.c
··· 29 29 * for IRQ management (e.g. start()->_SRS). 30 30 */ 31 31 32 - #include <linux/sysdev.h> 32 + #include <linux/syscore_ops.h> 33 33 #include <linux/kernel.h> 34 34 #include <linux/module.h> 35 35 #include <linux/init.h> ··· 757 757 return 0; 758 758 } 759 759 760 - static int irqrouter_resume(struct sys_device *dev) 760 + static void irqrouter_resume(void) 761 761 { 762 762 struct acpi_pci_link *link; 763 763 764 764 list_for_each_entry(link, &acpi_link_list, list) { 765 765 acpi_pci_link_resume(link); 766 766 } 767 - return 0; 768 767 } 769 768 770 769 static int acpi_pci_link_remove(struct acpi_device *device, int type) ··· 870 871 871 872 __setup("acpi_irq_balance", acpi_irq_balance_set); 872 873 873 - /* FIXME: we will remove this interface after all drivers call pci_disable_device */ 874 - static struct sysdev_class irqrouter_sysdev_class = { 875 - .name = "irqrouter", 874 + static struct syscore_ops irqrouter_syscore_ops = { 876 875 .resume = irqrouter_resume, 877 876 }; 878 877 879 - static struct sys_device device_irqrouter = { 880 - .id = 0, 881 - .cls = &irqrouter_sysdev_class, 882 - }; 883 - 884 - static int __init irqrouter_init_sysfs(void) 878 + static int __init irqrouter_init_ops(void) 885 879 { 886 - int error; 880 + if (!acpi_disabled && !acpi_noirq) 881 + register_syscore_ops(&irqrouter_syscore_ops); 887 882 888 - if (acpi_disabled || acpi_noirq) 889 - return 0; 890 - 891 - error = sysdev_class_register(&irqrouter_sysdev_class); 892 - if (!error) 893 - error = sysdev_register(&device_irqrouter); 894 - 895 - return error; 883 + return 0; 896 884 } 897 885 898 - device_initcall(irqrouter_init_sysfs); 886 + device_initcall(irqrouter_init_ops); 899 887 900 888 static int __init acpi_pci_link_init(void) 901 889 {