alistair23-linux/drivers/usb/core
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
..
buffer.c
config.c usbcore: get BOS descriptor set 2011-09-26 15:51:08 -07:00
devices.c USB: use usb_endpoint_maxp() instead of le16_to_cpu() 2011-08-23 09:47:40 -07:00
devio.c module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
driver.c USB merge for 3.4-rc1 2012-03-20 11:26:30 -07:00
endpoint.c USB: use usb_endpoint_maxp() instead of le16_to_cpu() 2011-08-23 09:47:40 -07:00
file.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
generic.c
hcd-pci.c usb: fix defined but not used warnings in hcd-pci.c 2012-02-28 10:53:08 -08:00
hcd.c usb: core: hcd: make hcd->irq unsigned 2012-03-01 09:31:22 -08:00
hub.c USB: dynamically allocate usb_device children pointers instead of using a fix array 2012-03-13 14:24:07 -07:00
inode.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
Kconfig
Makefile
message.c USB: message: cleanup min_t() cast in usb_sg_init() 2011-09-29 13:13:07 -07:00
notify.c usb: Add export.h for EXPORT_SYMBOL/THIS_MODULE where needed 2011-10-31 19:31:25 -04:00
otg_whitelist.h
quirks.c USB: add quirk for another camera 2012-01-03 16:48:56 -08:00
sysfs.c usb: Add support for indicating whether a port is removable 2012-02-09 08:40:11 -08:00
urb.c usb/core: remove "always" from usb_unlink_urb() kernel doc entry 2012-03-02 16:22:11 -08:00
usb.c USB: cleanup the handling of the PM complete call 2012-01-24 14:23:49 -08:00
usb.h USB: cleanup the handling of the PM complete call 2012-01-24 14:23:49 -08:00