@@ -30,7 +30,6 @@ static struct dentry *rootdir;
30
30
struct b43_debugfs_fops {
31
31
ssize_t (* read )(struct b43_wldev * dev , char * buf , size_t bufsize );
32
32
int (* write )(struct b43_wldev * dev , const char * buf , size_t count );
33
- struct file_operations fops ;
34
33
/* Offset of struct b43_dfs_file in struct b43_dfsentry */
35
34
size_t file_struct_offset ;
36
35
};
@@ -491,7 +490,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
491
490
size_t count , loff_t * ppos )
492
491
{
493
492
struct b43_wldev * dev ;
494
- struct b43_debugfs_fops * dfops ;
493
+ const struct b43_debugfs_fops * dfops ;
495
494
struct b43_dfs_file * dfile ;
496
495
ssize_t ret ;
497
496
char * buf ;
@@ -511,8 +510,7 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
511
510
goto out_unlock ;
512
511
}
513
512
514
- dfops = container_of (debugfs_real_fops (file ),
515
- struct b43_debugfs_fops , fops );
513
+ dfops = debugfs_get_aux (file );
516
514
if (!dfops -> read ) {
517
515
err = - ENOSYS ;
518
516
goto out_unlock ;
@@ -555,7 +553,7 @@ static ssize_t b43_debugfs_write(struct file *file,
555
553
size_t count , loff_t * ppos )
556
554
{
557
555
struct b43_wldev * dev ;
558
- struct b43_debugfs_fops * dfops ;
556
+ const struct b43_debugfs_fops * dfops ;
559
557
char * buf ;
560
558
int err = 0 ;
561
559
@@ -573,8 +571,7 @@ static ssize_t b43_debugfs_write(struct file *file,
573
571
goto out_unlock ;
574
572
}
575
573
576
- dfops = container_of (debugfs_real_fops (file ),
577
- struct b43_debugfs_fops , fops );
574
+ dfops = debugfs_get_aux (file );
578
575
if (!dfops -> write ) {
579
576
err = - ENOSYS ;
580
577
goto out_unlock ;
@@ -602,16 +599,16 @@ static ssize_t b43_debugfs_write(struct file *file,
602
599
}
603
600
604
601
602
+ static struct debugfs_short_fops debugfs_ops = {
603
+ .read = b43_debugfs_read ,
604
+ .write = b43_debugfs_write ,
605
+ .llseek = generic_file_llseek ,
606
+ };
607
+
605
608
#define B43_DEBUGFS_FOPS (name , _read , _write ) \
606
609
static struct b43_debugfs_fops fops_##name = { \
607
610
.read = _read, \
608
611
.write = _write, \
609
- .fops = { \
610
- .open = simple_open, \
611
- .read = b43_debugfs_read, \
612
- .write = b43_debugfs_write, \
613
- .llseek = generic_file_llseek, \
614
- }, \
615
612
.file_struct_offset = offsetof(struct b43_dfsentry, \
616
613
file_##name), \
617
614
}
@@ -703,9 +700,9 @@ void b43_debugfs_add_device(struct b43_wldev *dev)
703
700
704
701
#define ADD_FILE (name , mode ) \
705
702
do { \
706
- debugfs_create_file (__stringify(name), \
703
+ debugfs_create_file_aux (__stringify(name), \
707
704
mode, e->subdir, dev, \
708
- &fops_##name.fops); \
705
+ &fops_##name, &debugfs_ops); \
709
706
} while (0)
710
707
711
708
0 commit comments