summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-12 15:24:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-12 15:24:03 -0400
commitf632a8170a6b667ee4e3f552087588f0fe13c4bb (patch)
tree9fbdd3505f1471364265727dea1bc9d034cbed8f /arch/x86/kernel
parentef8f3d48afd6a17a0dae8c277c2f539c2f19fd16 (diff)
parentc33d442328f556460b79aba6058adb37bb555389 (diff)
Merge tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core and debugfs updates from Greg KH: "Here is the "big" driver core and debugfs changes for 5.3-rc1 It's a lot of different patches, all across the tree due to some api changes and lots of debugfs cleanups. Other than the debugfs cleanups, in this set of changes we have: - bus iteration function cleanups - scripts/get_abi.pl tool to display and parse Documentation/ABI entries in a simple way - cleanups to Documenatation/ABI/ entries to make them parse easier due to typos and other minor things - default_attrs use for some ktype users - driver model documentation file conversions to .rst - compressed firmware file loading - deferred probe fixes All of these have been in linux-next for a while, with a bunch of merge issues that Stephen has been patient with me for" * tag 'driver-core-5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (102 commits) debugfs: make error message a bit more verbose orangefs: fix build warning from debugfs cleanup patch ubifs: fix build warning after debugfs cleanup patch driver: core: Allow subsystems to continue deferring probe drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT arch_topology: Remove error messages on out-of-memory conditions lib: notifier-error-inject: no need to check return value of debugfs_create functions swiotlb: no need to check return value of debugfs_create functions ceph: no need to check return value of debugfs_create functions sunrpc: no need to check return value of debugfs_create functions ubifs: no need to check return value of debugfs_create functions orangefs: no need to check return value of debugfs_create functions nfsd: no need to check return value of debugfs_create functions lib: 842: no need to check return value of debugfs_create functions debugfs: provide pr_fmt() macro debugfs: log errors when something goes wrong drivers: s390/cio: Fix compilation warning about const qualifiers drivers: Add generic helper to match by of_node driver_find_device: Unify the match function with class_find_device() bus_find_device: Unify the match callback with class_find_device ...
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/kdebugfs.c60
1 files changed, 11 insertions, 49 deletions
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c
index 7670ac2bda3a..edaa30b20841 100644
--- a/arch/x86/kernel/kdebugfs.c
+++ b/arch/x86/kernel/kdebugfs.c
@@ -67,33 +67,18 @@ static const struct file_operations fops_setup_data = {
67 .llseek = default_llseek, 67 .llseek = default_llseek,
68}; 68};
69 69
70static int __init 70static void __init
71create_setup_data_node(struct dentry *parent, int no, 71create_setup_data_node(struct dentry *parent, int no,
72 struct setup_data_node *node) 72 struct setup_data_node *node)
73{ 73{
74 struct dentry *d, *type, *data; 74 struct dentry *d;
75 char buf[16]; 75 char buf[16];
76 76
77 sprintf(buf, "%d", no); 77 sprintf(buf, "%d", no);
78 d = debugfs_create_dir(buf, parent); 78 d = debugfs_create_dir(buf, parent);
79 if (!d)
80 return -ENOMEM;
81
82 type = debugfs_create_x32("type", S_IRUGO, d, &node->type);
83 if (!type)
84 goto err_dir;
85
86 data = debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data);
87 if (!data)
88 goto err_type;
89 79
90 return 0; 80 debugfs_create_x32("type", S_IRUGO, d, &node->type);
91 81 debugfs_create_file("data", S_IRUGO, d, node, &fops_setup_data);
92err_type:
93 debugfs_remove(type);
94err_dir:
95 debugfs_remove(d);
96 return -ENOMEM;
97} 82}
98 83
99static int __init create_setup_data_nodes(struct dentry *parent) 84static int __init create_setup_data_nodes(struct dentry *parent)
@@ -106,8 +91,6 @@ static int __init create_setup_data_nodes(struct dentry *parent)
106 int no = 0; 91 int no = 0;
107 92
108 d = debugfs_create_dir("setup_data", parent); 93 d = debugfs_create_dir("setup_data", parent);
109 if (!d)
110 return -ENOMEM;
111 94
112 pa_data = boot_params.hdr.setup_data; 95 pa_data = boot_params.hdr.setup_data;
113 96
@@ -128,19 +111,17 @@ static int __init create_setup_data_nodes(struct dentry *parent)
128 node->paddr = pa_data; 111 node->paddr = pa_data;
129 node->type = data->type; 112 node->type = data->type;
130 node->len = data->len; 113 node->len = data->len;
131 error = create_setup_data_node(d, no, node); 114 create_setup_data_node(d, no, node);
132 pa_data = data->next; 115 pa_data = data->next;
133 116
134 memunmap(data); 117 memunmap(data);
135 if (error)
136 goto err_dir;
137 no++; 118 no++;
138 } 119 }
139 120
140 return 0; 121 return 0;
141 122
142err_dir: 123err_dir:
143 debugfs_remove(d); 124 debugfs_remove_recursive(d);
144 return error; 125 return error;
145} 126}
146 127
@@ -151,35 +132,18 @@ static struct debugfs_blob_wrapper boot_params_blob = {
151 132
152static int __init boot_params_kdebugfs_init(void) 133static int __init boot_params_kdebugfs_init(void)
153{ 134{
154 struct dentry *dbp, *version, *data; 135 struct dentry *dbp;
155 int error = -ENOMEM; 136 int error;
156 137
157 dbp = debugfs_create_dir("boot_params", arch_debugfs_dir); 138 dbp = debugfs_create_dir("boot_params", arch_debugfs_dir);
158 if (!dbp)
159 return -ENOMEM;
160
161 version = debugfs_create_x16("version", S_IRUGO, dbp,
162 &boot_params.hdr.version);
163 if (!version)
164 goto err_dir;
165 139
166 data = debugfs_create_blob("data", S_IRUGO, dbp, 140 debugfs_create_x16("version", S_IRUGO, dbp, &boot_params.hdr.version);
167 &boot_params_blob); 141 debugfs_create_blob("data", S_IRUGO, dbp, &boot_params_blob);
168 if (!data)
169 goto err_version;
170 142
171 error = create_setup_data_nodes(dbp); 143 error = create_setup_data_nodes(dbp);
172 if (error) 144 if (error)
173 goto err_data; 145 debugfs_remove_recursive(dbp);
174 146
175 return 0;
176
177err_data:
178 debugfs_remove(data);
179err_version:
180 debugfs_remove(version);
181err_dir:
182 debugfs_remove(dbp);
183 return error; 147 return error;
184} 148}
185#endif /* CONFIG_DEBUG_BOOT_PARAMS */ 149#endif /* CONFIG_DEBUG_BOOT_PARAMS */
@@ -189,8 +153,6 @@ static int __init arch_kdebugfs_init(void)
189 int error = 0; 153 int error = 0;
190 154
191 arch_debugfs_dir = debugfs_create_dir("x86", NULL); 155 arch_debugfs_dir = debugfs_create_dir("x86", NULL);
192 if (!arch_debugfs_dir)
193 return -ENOMEM;
194 156
195#ifdef CONFIG_DEBUG_BOOT_PARAMS 157#ifdef CONFIG_DEBUG_BOOT_PARAMS
196 error = boot_params_kdebugfs_init(); 158 error = boot_params_kdebugfs_init();