diff options
author | Octavian Purdila <octavian.purdila@intel.com> | 2016-07-08 18:13:13 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-07-08 21:52:35 +0200 |
commit | 0bf54fcd95042bd178cb25368422cf4474fc8492 (patch) | |
tree | a2fe90bbf9bc61e98537458bdf1ade479288f669 /drivers/acpi/configfs.c | |
parent | efi / ACPI: load SSTDs from EFI variables (diff) | |
download | linux-0bf54fcd95042bd178cb25368422cf4474fc8492.tar.xz linux-0bf54fcd95042bd178cb25368422cf4474fc8492.zip |
ACPI: add support for configfs
Register the ACPI subsystem with configfs.
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/acpi/configfs.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/acpi/configfs.c b/drivers/acpi/configfs.c new file mode 100644 index 000000000000..44b463f6fca5 --- /dev/null +++ b/drivers/acpi/configfs.c @@ -0,0 +1,53 @@ +/* + * ACPI configfs support + * + * Copyright (c) 2016 Intel Corporation + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/configfs.h> +#include <linux/acpi.h> + +static struct config_item_type acpi_root_group_type = { + .ct_owner = THIS_MODULE, +}; + +static struct configfs_subsystem acpi_configfs = { + .su_group = { + .cg_item = { + .ci_namebuf = "acpi", + .ci_type = &acpi_root_group_type, + }, + }, + .su_mutex = __MUTEX_INITIALIZER(acpi_configfs.su_mutex), +}; + +static int __init acpi_configfs_init(void) +{ + int ret; + struct config_group *root = &acpi_configfs.su_group; + + config_group_init(root); + + ret = configfs_register_subsystem(&acpi_configfs); + if (ret) + return ret; + + return 0; +} +module_init(acpi_configfs_init); + +static void __exit acpi_configfs_exit(void) +{ + configfs_unregister_subsystem(&acpi_configfs); +} +module_exit(acpi_configfs_exit); + +MODULE_AUTHOR("Octavian Purdila <octavian.purdila@intel.com>"); +MODULE_DESCRIPTION("ACPI configfs support"); +MODULE_LICENSE("GPL v2"); |