--- a/drivers/net/wireless/ath/carl9170/debug.c +++ b/drivers/net/wireless/ath/carl9170/debug.c @@ -54,6 +54,7 @@ struct carl9170_debugfs_fops { char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize, ssize_t *len); ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size); + const struct file_operations fops; enum carl9170_device_state req_dev_state; }; @@ -61,7 +62,7 @@ struct carl9170_debugfs_fops { static ssize_t carl9170_debugfs_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos) { - const struct carl9170_debugfs_fops *dfops; + struct carl9170_debugfs_fops *dfops; struct ar9170 *ar; char *buf = NULL, *res_buf = NULL; ssize_t ret = 0; @@ -74,7 +75,8 @@ static ssize_t carl9170_debugfs_read(str if (!ar) return -ENODEV; - dfops = debugfs_get_aux(file); + dfops = container_of(debugfs_real_fops(file), + struct carl9170_debugfs_fops, fops); if (!dfops->read) return -ENOSYS; @@ -111,7 +113,7 @@ out_free: static ssize_t carl9170_debugfs_write(struct file *file, const char __user *userbuf, size_t count, loff_t *ppos) { - const struct carl9170_debugfs_fops *dfops; + struct carl9170_debugfs_fops *dfops; struct ar9170 *ar; char *buf = NULL; int err = 0; @@ -126,7 +128,8 @@ static ssize_t carl9170_debugfs_write(st if (!ar) return -ENODEV; - dfops = debugfs_get_aux(file); + dfops = container_of(debugfs_real_fops(file), + struct carl9170_debugfs_fops, fops); if (!dfops->write) return -ENOSYS; @@ -162,11 +165,6 @@ out_free: return err; } -static struct debugfs_short_fops debugfs_fops = { - .read = carl9170_debugfs_read, - .write = carl9170_debugfs_write, -}; - #define __DEBUGFS_DECLARE_FILE(name, _read, _write, _read_bufsize, \ _attr, _dstate) \ static const struct carl9170_debugfs_fops carl_debugfs_##name ##_ops = {\ @@ -175,6 +173,12 @@ static const struct carl9170_debugfs_fop .write = _write, \ .attr = _attr, \ .req_dev_state = _dstate, \ + .fops = { \ + .open = simple_open, \ + .read = carl9170_debugfs_read, \ + .write = carl9170_debugfs_write, \ + .owner = THIS_MODULE \ + }, \ } #define DEBUGFS_DECLARE_FILE(name, _read, _write, _read_bufsize, _attr) \ @@ -812,9 +816,9 @@ void carl9170_debugfs_register(struct ar ar->hw->wiphy->debugfsdir); #define DEBUGFS_ADD(name) \ - debugfs_create_file_aux(#name, carl_debugfs_##name ##_ops.attr, \ - ar->debug_dir, ar, &carl_debugfs_##name ## _ops, \ - &debugfs_fops) + debugfs_create_file(#name, carl_debugfs_##name ##_ops.attr, \ + ar->debug_dir, ar, \ + &carl_debugfs_##name ## _ops.fops) DEBUGFS_ADD(usb_tx_anch_urbs); DEBUGFS_ADD(usb_rx_pool_urbs); --- a/drivers/net/wireless/broadcom/b43/debugfs.c +++ b/drivers/net/wireless/broadcom/b43/debugfs.c @@ -30,6 +30,7 @@ static struct dentry *rootdir; struct b43_debugfs_fops { ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize); int (*write)(struct b43_wldev *dev, const char *buf, size_t count); + struct file_operations fops; /* Offset of struct b43_dfs_file in struct b43_dfsentry */ size_t file_struct_offset; }; @@ -490,7 +491,7 @@ static ssize_t b43_debugfs_read(struct f size_t count, loff_t *ppos) { struct b43_wldev *dev; - const struct b43_debugfs_fops *dfops; + struct b43_debugfs_fops *dfops; struct b43_dfs_file *dfile; ssize_t ret; char *buf; @@ -510,7 +511,8 @@ static ssize_t b43_debugfs_read(struct f goto out_unlock; } - dfops = debugfs_get_aux(file); + dfops = container_of(debugfs_real_fops(file), + struct b43_debugfs_fops, fops); if (!dfops->read) { err = -ENOSYS; goto out_unlock; @@ -553,7 +555,7 @@ static ssize_t b43_debugfs_write(struct size_t count, loff_t *ppos) { struct b43_wldev *dev; - const struct b43_debugfs_fops *dfops; + struct b43_debugfs_fops *dfops; char *buf; int err = 0; @@ -571,7 +573,8 @@ static ssize_t b43_debugfs_write(struct goto out_unlock; } - dfops = debugfs_get_aux(file); + dfops = container_of(debugfs_real_fops(file), + struct b43_debugfs_fops, fops); if (!dfops->write) { err = -ENOSYS; goto out_unlock; @@ -599,16 +602,16 @@ out_unlock: } -static struct debugfs_short_fops debugfs_ops = { - .read = b43_debugfs_read, - .write = b43_debugfs_write, - .llseek = generic_file_llseek, -}; - #define B43_DEBUGFS_FOPS(name, _read, _write) \ static struct b43_debugfs_fops fops_##name = { \ .read = _read, \ .write = _write, \ + .fops = { \ + .open = simple_open, \ + .read = b43_debugfs_read, \ + .write = b43_debugfs_write, \ + .llseek = generic_file_llseek, \ + }, \ .file_struct_offset = offsetof(struct b43_dfsentry, \ file_##name), \ } @@ -700,9 +703,9 @@ void b43_debugfs_add_device(struct b43_w #define ADD_FILE(name, mode) \ do { \ - debugfs_create_file_aux(__stringify(name), \ + debugfs_create_file(__stringify(name), \ mode, e->subdir, dev, \ - &fops_##name, &debugfs_ops); \ + &fops_##name.fops); \ } while (0) --- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c +++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c @@ -31,6 +31,7 @@ static struct dentry *rootdir; struct b43legacy_debugfs_fops { ssize_t (*read)(struct b43legacy_wldev *dev, char *buf, size_t bufsize); int (*write)(struct b43legacy_wldev *dev, const char *buf, size_t count); + struct file_operations fops; /* Offset of struct b43legacy_dfs_file in struct b43legacy_dfsentry */ size_t file_struct_offset; /* Take wl->irq_lock before calling read/write? */ @@ -187,7 +188,7 @@ static ssize_t b43legacy_debugfs_read(st size_t count, loff_t *ppos) { struct b43legacy_wldev *dev; - const struct b43legacy_debugfs_fops *dfops; + struct b43legacy_debugfs_fops *dfops; struct b43legacy_dfs_file *dfile; ssize_t ret; char *buf; @@ -207,7 +208,8 @@ static ssize_t b43legacy_debugfs_read(st goto out_unlock; } - dfops = debugfs_get_aux(file); + dfops = container_of(debugfs_real_fops(file), + struct b43legacy_debugfs_fops, fops); if (!dfops->read) { err = -ENOSYS; goto out_unlock; @@ -255,7 +257,7 @@ static ssize_t b43legacy_debugfs_write(s size_t count, loff_t *ppos) { struct b43legacy_wldev *dev; - const struct b43legacy_debugfs_fops *dfops; + struct b43legacy_debugfs_fops *dfops; char *buf; int err = 0; @@ -273,7 +275,8 @@ static ssize_t b43legacy_debugfs_write(s goto out_unlock; } - dfops = debugfs_get_aux(file); + dfops = container_of(debugfs_real_fops(file), + struct b43legacy_debugfs_fops, fops); if (!dfops->write) { err = -ENOSYS; goto out_unlock; @@ -305,16 +308,17 @@ out_unlock: return err ? err : count; } -static struct debugfs_short_fops debugfs_ops = { - .read = b43legacy_debugfs_read, - .write = b43legacy_debugfs_write, - .llseek = generic_file_llseek -}; #define B43legacy_DEBUGFS_FOPS(name, _read, _write, _take_irqlock) \ static struct b43legacy_debugfs_fops fops_##name = { \ .read = _read, \ .write = _write, \ + .fops = { \ + .open = simple_open, \ + .read = b43legacy_debugfs_read, \ + .write = b43legacy_debugfs_write, \ + .llseek = generic_file_llseek, \ + }, \ .file_struct_offset = offsetof(struct b43legacy_dfsentry, \ file_##name), \ .take_irqlock = _take_irqlock, \ @@ -382,9 +386,9 @@ void b43legacy_debugfs_add_device(struct #define ADD_FILE(name, mode) \ do { \ - debugfs_create_file_aux(__stringify(name), mode, \ + debugfs_create_file(__stringify(name), mode, \ e->subdir, dev, \ - &fops_##name, &debugfs_ops); \ + &fops_##name.fops); \ } while (0)