dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/drivers/mtd
Stephen Boyd 234e340582 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>
2012-04-05 15:25:50 -07:00
..
chips mtd: use for_each_clear_bit() 2012-03-23 16:58:34 -07:00
devices MTD: Relax dependencies 2012-03-25 00:29:56 +01:00
lpddr mtd: lpddr: drop unnecessary zeroing 2012-01-09 18:24:48 +00:00
maps Merge branch 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2012-03-27 18:29:53 -07:00
nand Merge branch 'for-linus-3.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2012-03-27 18:29:53 -07:00
onenand MTD: Relax dependencies 2012-03-25 00:29:56 +01:00
tests mtd: introduce mtd_can_have_bb helper 2012-01-09 18:26:24 +00:00
ubi simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
Kconfig MTD: Relax dependencies 2012-03-25 00:29:56 +01:00
Makefile mtd: maps: bcm963xx-flash: make CFE partition parsing an mtd parser 2012-01-09 18:15:31 +00:00
afs.c mtd: introduce mtd_read interface 2012-01-09 18:25:19 +00:00
ar7part.c mtd: introduce mtd_read interface 2012-01-09 18:25:19 +00:00
bcm63xxpart.c mtd: introduce mtd_read interface 2012-01-09 18:25:19 +00:00
cmdlinepart.c Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
ftl.c mtd: do not use mtd->sync directly 2012-01-09 18:26:21 +00:00
inftlcore.c mtd: introduce mtd_write_oob interface 2012-01-09 18:25:24 +00:00
inftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
mtd_blkdevs.c mtd: mtd_blkdevs: don't increase 'open' count on error path 2012-01-09 18:04:01 +00:00
mtdblock.c mtd: do not use mtd->sync directly 2012-01-09 18:26:21 +00:00
mtdblock_ro.c mtd: introduce mtd_write interface 2012-01-09 18:25:20 +00:00
mtdchar.c magic.h: move some FS magic numbers into magic.h 2012-03-23 16:58:31 -07:00
mtdconcat.c mtd: do not use mtd->block_markbad directly 2012-01-09 18:26:26 +00:00
mtdcore.c mtd: fix MTD suspend 2012-01-30 14:23:07 +00:00
mtdcore.h mtd: hide parse_mtd_partitions 2011-09-11 15:02:13 +03:00
mtdoops.c kexec: remove KMSG_DUMP_KEXEC 2012-01-12 20:13:11 -08:00
mtdpart.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
mtdsuper.c Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
mtdswap.c mtd: do not use mtd->block_markbad directly 2012-01-09 18:26:26 +00:00
nftlcore.c mtd: introduce mtd_can_have_bb helper 2012-01-09 18:26:24 +00:00
nftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
ofpart.c mtd: ofpart: add ofoldpart alias 2011-09-11 15:02:14 +03:00
redboot.c mtd: introduce mtd_can_have_bb helper 2012-01-09 18:26:24 +00:00
rfd_ftl.c mtd: do not use mtd->sync directly 2012-01-09 18:26:21 +00:00
sm_ftl.c mtd: introduce mtd_has_oob helper 2012-01-09 18:26:08 +00:00
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible 2010-10-25 01:33:08 +01:00
ssfdc.c mtd: introduce mtd_block_isbad interface 2012-01-09 18:25:47 +00:00