@@ -232,16 +232,7 @@ static struct xhci_file_map ring_files[] = {
232
232
233
233
static int xhci_ring_open (struct inode * inode , struct file * file )
234
234
{
235
- int i ;
236
- struct xhci_file_map * f_map ;
237
- const char * file_name = file_dentry (file )-> d_iname ;
238
-
239
- for (i = 0 ; i < ARRAY_SIZE (ring_files ); i ++ ) {
240
- f_map = & ring_files [i ];
241
-
242
- if (strcmp (f_map -> name , file_name ) == 0 )
243
- break ;
244
- }
235
+ const struct xhci_file_map * f_map = debugfs_get_aux (file );
245
236
246
237
return single_open (file , f_map -> show , inode -> i_private );
247
238
}
@@ -318,16 +309,7 @@ static struct xhci_file_map context_files[] = {
318
309
319
310
static int xhci_context_open (struct inode * inode , struct file * file )
320
311
{
321
- int i ;
322
- struct xhci_file_map * f_map ;
323
- const char * file_name = file_dentry (file )-> d_iname ;
324
-
325
- for (i = 0 ; i < ARRAY_SIZE (context_files ); i ++ ) {
326
- f_map = & context_files [i ];
327
-
328
- if (strcmp (f_map -> name , file_name ) == 0 )
329
- break ;
330
- }
312
+ const struct xhci_file_map * f_map = debugfs_get_aux (file );
331
313
332
314
return single_open (file , f_map -> show , inode -> i_private );
333
315
}
@@ -410,7 +392,8 @@ static void xhci_debugfs_create_files(struct xhci_hcd *xhci,
410
392
int i ;
411
393
412
394
for (i = 0 ; i < nentries ; i ++ )
413
- debugfs_create_file (files [i ].name , 0444 , parent , data , fops );
395
+ debugfs_create_file_aux (files [i ].name , 0444 , parent ,
396
+ data , & files [i ], fops );
414
397
}
415
398
416
399
static struct dentry * xhci_debugfs_create_ring_dir (struct xhci_hcd * xhci ,
0 commit comments