aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/debugfs.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2012-04-05 17:25:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-05 18:25:50 -0400
commit234e340582901211f40d8c732afc49f0630ecf05 (patch)
tree753076500dfd883b3db56d4f5410af31d8945623 /drivers/net/wireless/mwifiex/debugfs.c
parent9b3ae64be658a573b33d05a8dc73b08d3345fa44 (diff)
simple_open: automatically convert to simple_open()
Many users of debugfs copy the implementation of default_open() when they want to support a custom read/write function op. This leads to a proliferation of the default_open() implementation across the entire tree. Now that the common implementation has been consolidated into libfs we can replace all the users of this function with simple_open(). This replacement was done with the following semantic patch: <smpl> @ open @ identifier open_f != simple_open; identifier i, f; @@ -int open_f(struct inode *i, struct file *f) -{ ( -if (i->i_private) -f->private_data = i->i_private; | -f->private_data = i->i_private; ) -return 0; -} @ has_open depends on open @ identifier fops; identifier open.open_f; @@ struct file_operations fops = { ... -.open = open_f, +.open = simple_open, ... }; </smpl> [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/debugfs.c')
-rw-r--r--drivers/net/wireless/mwifiex/debugfs.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index d26a78b6b3c4..1a845074c52a 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -140,18 +140,6 @@ static struct mwifiex_debug_data items[] = {
140static int num_of_items = ARRAY_SIZE(items); 140static int num_of_items = ARRAY_SIZE(items);
141 141
142/* 142/*
143 * Generic proc file open handler.
144 *
145 * This function is called every time a file is accessed for read or write.
146 */
147static int
148mwifiex_open_generic(struct inode *inode, struct file *file)
149{
150 file->private_data = inode->i_private;
151 return 0;
152}
153
154/*
155 * Proc info file read handler. 143 * Proc info file read handler.
156 * 144 *
157 * This function is called when the 'info' file is opened for reading. 145 * This function is called when the 'info' file is opened for reading.
@@ -676,19 +664,19 @@ done:
676static const struct file_operations mwifiex_dfs_##name##_fops = { \ 664static const struct file_operations mwifiex_dfs_##name##_fops = { \
677 .read = mwifiex_##name##_read, \ 665 .read = mwifiex_##name##_read, \
678 .write = mwifiex_##name##_write, \ 666 .write = mwifiex_##name##_write, \
679 .open = mwifiex_open_generic, \ 667 .open = simple_open, \
680}; 668};
681 669
682#define MWIFIEX_DFS_FILE_READ_OPS(name) \ 670#define MWIFIEX_DFS_FILE_READ_OPS(name) \
683static const struct file_operations mwifiex_dfs_##name##_fops = { \ 671static const struct file_operations mwifiex_dfs_##name##_fops = { \
684 .read = mwifiex_##name##_read, \ 672 .read = mwifiex_##name##_read, \
685 .open = mwifiex_open_generic, \ 673 .open = simple_open, \
686}; 674};
687 675
688#define MWIFIEX_DFS_FILE_WRITE_OPS(name) \ 676#define MWIFIEX_DFS_FILE_WRITE_OPS(name) \
689static const struct file_operations mwifiex_dfs_##name##_fops = { \ 677static const struct file_operations mwifiex_dfs_##name##_fops = { \
690 .write = mwifiex_##name##_write, \ 678 .write = mwifiex_##name##_write, \
691 .open = mwifiex_open_generic, \ 679 .open = simple_open, \
692}; 680};
693 681
694 682