Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / base / firmware_loader / fallback_table.c
blob8432ab2c3b3ccda0f74579009658231b25473651
1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/types.h>
4 #include <linux/kconfig.h>
5 #include <linux/list.h>
6 #include <linux/slab.h>
7 #include <linux/export.h>
8 #include <linux/security.h>
9 #include <linux/highmem.h>
10 #include <linux/umh.h>
11 #include <linux/sysctl.h>
13 #include "fallback.h"
14 #include "firmware.h"
17 * firmware fallback configuration table
20 struct firmware_fallback_config fw_fallback_config = {
21 .force_sysfs_fallback = IS_ENABLED(CONFIG_FW_LOADER_USER_HELPER_FALLBACK),
22 .loading_timeout = 60,
23 .old_timeout = 60,
25 EXPORT_SYMBOL_NS_GPL(fw_fallback_config, FIRMWARE_LOADER_PRIVATE);
27 #ifdef CONFIG_SYSCTL
28 static struct ctl_table firmware_config_table[] = {
30 .procname = "force_sysfs_fallback",
31 .data = &fw_fallback_config.force_sysfs_fallback,
32 .maxlen = sizeof(unsigned int),
33 .mode = 0644,
34 .proc_handler = proc_douintvec_minmax,
35 .extra1 = SYSCTL_ZERO,
36 .extra2 = SYSCTL_ONE,
39 .procname = "ignore_sysfs_fallback",
40 .data = &fw_fallback_config.ignore_sysfs_fallback,
41 .maxlen = sizeof(unsigned int),
42 .mode = 0644,
43 .proc_handler = proc_douintvec_minmax,
44 .extra1 = SYSCTL_ZERO,
45 .extra2 = SYSCTL_ONE,
49 static struct ctl_table_header *firmware_config_sysct_table_header;
50 int register_firmware_config_sysctl(void)
52 firmware_config_sysct_table_header =
53 register_sysctl("kernel/firmware_config",
54 firmware_config_table);
55 if (!firmware_config_sysct_table_header)
56 return -ENOMEM;
57 return 0;
59 EXPORT_SYMBOL_NS_GPL(register_firmware_config_sysctl, FIRMWARE_LOADER_PRIVATE);
61 void unregister_firmware_config_sysctl(void)
63 unregister_sysctl_table(firmware_config_sysct_table_header);
64 firmware_config_sysct_table_header = NULL;
66 EXPORT_SYMBOL_NS_GPL(unregister_firmware_config_sysctl, FIRMWARE_LOADER_PRIVATE);
68 #endif /* CONFIG_SYSCTL */