mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 16:47:42 +00:00
xhci: don't mess with ->d_iname
use debugs_{creat_file,get}_aux() instead Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Link: https://lore.kernel.org/r/20250112080705.141166-14-viro@zeniv.linux.org.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c63254a747
commit
e777ba7bbd
@ -232,16 +232,7 @@ static struct xhci_file_map ring_files[] = {
|
||||
|
||||
static int xhci_ring_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int i;
|
||||
struct xhci_file_map *f_map;
|
||||
const char *file_name = file_dentry(file)->d_iname;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ring_files); i++) {
|
||||
f_map = &ring_files[i];
|
||||
|
||||
if (strcmp(f_map->name, file_name) == 0)
|
||||
break;
|
||||
}
|
||||
const struct xhci_file_map *f_map = debugfs_get_aux(file);
|
||||
|
||||
return single_open(file, f_map->show, inode->i_private);
|
||||
}
|
||||
@ -318,16 +309,7 @@ static struct xhci_file_map context_files[] = {
|
||||
|
||||
static int xhci_context_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
int i;
|
||||
struct xhci_file_map *f_map;
|
||||
const char *file_name = file_dentry(file)->d_iname;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(context_files); i++) {
|
||||
f_map = &context_files[i];
|
||||
|
||||
if (strcmp(f_map->name, file_name) == 0)
|
||||
break;
|
||||
}
|
||||
const struct xhci_file_map *f_map = debugfs_get_aux(file);
|
||||
|
||||
return single_open(file, f_map->show, inode->i_private);
|
||||
}
|
||||
@ -410,7 +392,8 @@ static void xhci_debugfs_create_files(struct xhci_hcd *xhci,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nentries; i++)
|
||||
debugfs_create_file(files[i].name, 0444, parent, data, fops);
|
||||
debugfs_create_file_aux(files[i].name, 0444, parent,
|
||||
data, &files[i], fops);
|
||||
}
|
||||
|
||||
static struct dentry *xhci_debugfs_create_ring_dir(struct xhci_hcd *xhci,
|
||||
|
Loading…
x
Reference in New Issue
Block a user