<!DOCTYPE html>
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
Update callers with dynamic table/path to use template arguments. Signed-off-by: Mauricio Faria de Oliveira <mfo@ igalia. com> --- drivers/parport/procfs. c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-)</div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;"></div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannery52ol03 { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #c2d4d4 !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtony52ol03:hover, .pfptPrimaryButtony52ol03:focus {
background-color: #a2b1b1 !important; }
.pfptPrimaryButtony52ol03:active {
background-color: #828e8e !important; }
html:root, html:root>body { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><body><pre style="font-family: sans-serif; font-size: 100%; white-space: pre-wrap; word-wrap: break-word">Update callers with dynamic table/path to use template arguments.
Signed-off-by: Mauricio Faria de Oliveira <mfo@igalia.com>
---
drivers/parport/procfs.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index cda3221e386ed7a4afc898b3d0313081dee5b49b..7c048e9a973aa96251930e21581aed045c41cc35 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -13,7 +13,7 @@
* Cleaned up include files - Russell King <linux@arm.uk.linux.org>
*/
-#define SYSCTL_MODULE_ALIASES_DISABLE
+#define SYSCTL_MODULE_ALIASES_UNIQUE_ID
#include <linux/string.h>
#include <linux/init.h>
@@ -434,13 +434,17 @@ int parport_proc_register(struct parport *port)
#endif /* IEEE 1284 support */
}
- tmp_dir_path = kasprintf(GFP_KERNEL, "dev/parport/%s/devices", port->name);
+#define tmp_dir_tmpl "dev/parport/%s/devices"
+ tmp_dir_path = kasprintf(GFP_KERNEL, tmp_dir_tmpl, port->name);
if (!tmp_dir_path) {
err = -ENOMEM;
goto exit_free_t;
}
- t->devices_header = register_sysctl(tmp_dir_path, t->device_dir);
+ t->devices_header = register_sysctl(tmp_dir_path, t->device_dir,
+ parport_sysctl_template.device_dir,
+ tmp_dir_tmpl);
+#undef tmp_dir_tmpl
if (t->devices_header == NULL) {
err = -ENOENT;
goto exit_free_tmp_dir_path;
@@ -448,13 +452,17 @@ int parport_proc_register(struct parport *port)
kfree(tmp_dir_path);
- tmp_dir_path = kasprintf(GFP_KERNEL, "dev/parport/%s", port->name);
+#define tmp_dir_tmpl "dev/parport/%s"
+ tmp_dir_path = kasprintf(GFP_KERNEL, tmp_dir_tmpl, port->name);
if (!tmp_dir_path) {
err = -ENOMEM;
goto unregister_devices_h;
}
- t->port_header = register_sysctl(tmp_dir_path, t->vars);
+ t->port_header = register_sysctl(tmp_dir_path, t->vars,
+ parport_sysctl_template.vars,
+ tmp_dir_tmpl);
+#undef tmp_dir_tmpl
if (t->port_header == NULL) {
err = -ENOENT;
goto unregister_devices_h;
@@ -500,7 +508,8 @@ int parport_device_proc_register(struct pardevice *device)
return -ENOMEM;
/* Allocate a buffer for two paths: dev/parport/PORT/devices/DEVICE. */
- tmp_dir_path = kasprintf(GFP_KERNEL, "dev/parport/%s/devices/%s", port->name, device->name);
+#define tmp_dir_tmpl "dev/parport/%s/devices/%s"
+ tmp_dir_path = kasprintf(GFP_KERNEL, tmp_dir_tmpl, port->name, device->name);
if (!tmp_dir_path) {
err = -ENOMEM;
goto exit_free_t;
@@ -508,7 +517,10 @@ int parport_device_proc_register(struct pardevice *device)
t->vars[0].data = &device->timeslice;
- t->sysctl_header = register_sysctl(tmp_dir_path, t->vars);
+ t->sysctl_header = register_sysctl(tmp_dir_path, t->vars,
+ parport_device_sysctl_template.vars,
+ tmp_dir_tmpl);
+#undef tmp_dir_tmpl
if (t->sysctl_header == NULL) {
kfree(t);
t = NULL;
--
2.47.3
</pre></body></html>