linux/drivers
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
..
accessibility
acpi simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
amba
ata 1) AHCI regression fix. A recent "make driver conform to spec" change 2012-03-22 20:22:30 -07:00
atm
auxdisplay
base simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
bcma
block nbd: rename the nbd_device variable from lo to nbd 2012-03-28 17:14:37 -07:00
bluetooth simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
cdrom
char simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
clk
clocksource ARM: device tree work 2012-03-27 16:47:35 -07:00
connector
cpufreq Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq 2012-03-23 17:56:39 -07:00
cpuidle
crypto Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-22 18:15:32 -07:00
dca
devfreq ARM: global cleanups 2012-03-27 16:03:32 -07:00
dio
dma simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
edac The following text was taken from the original review request: 2012-03-24 10:41:37 -07:00
eisa
firewire IEEE 1394 (FireWire) subsystem updates post v3.3: 2012-03-22 20:31:15 -07:00
firmware
gpio Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
gpu simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
hid simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
hv
hwmon hwmon: Add MCP3021 ADC driver 2012-03-23 10:02:20 +01:00
hwspinlock
i2c ARM: device tree work 2012-03-27 16:47:35 -07:00
ide ide: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:17 +08:00
idle simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
ieee802154
infiniband Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2012-03-22 12:38:04 -07:00
input Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
iommu simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
leds ARM: board specific updates 2012-03-27 16:27:28 -07:00
lguest
macintosh Core device tree changes for Linux v3.4 2012-03-21 10:30:03 -07:00
mca
md md updates for 3.4 2012-03-22 12:29:50 -07:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-03-23 14:39:09 -07:00
memstick memstick: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:19 +08:00
message
mfd simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
misc simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
mmc ARM: driver specific updates 2012-03-27 16:41:24 -07:00
mtd simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
net simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
nfc
nubus
of Merge branch 'for-armsoc' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:30:49 -07:00
oprofile simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
parisc Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
parport
pci Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
pcmcia Merge branch 'platforms' of git://git.linaro.org/people/rmk/linux-arm 2012-03-27 18:17:02 -07:00
pinctrl
platform Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci 2012-03-23 14:02:12 -07:00
pnp
power The following text was taken from the original review request: 2012-03-24 10:41:37 -07:00
pps
ps3
ptp
rapidio
regulator ARM: driver specific updates 2012-03-27 16:41:24 -07:00
remoteproc simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
rpmsg
rtc drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callback 2012-04-05 15:25:50 -07:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2012-03-27 18:36:38 -07:00
sbus
scsi simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
sfi
sh
sn
spi simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-03-20 21:04:47 -07:00
staging The following text was taken from the original review request: 2012-03-24 10:24:31 -07:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2012-03-22 12:38:04 -07:00
tc
thermal
tty simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
uio
usb simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
uwb simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
vhost Merge branch 'vhost-net' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost 2012-03-23 14:46:48 -04:00
video backlight: fix typo in tosa_lcd.c 2012-03-28 17:14:37 -07:00
virt
virtio
vlynq
w1
watchdog ARM: device tree work 2012-03-27 16:47:35 -07:00
xen One tiny feature that accidentally got lost in the initial git pull: 2012-03-24 12:20:25 -07:00
zorro
Kconfig remoteproc/rpmsg: new subsystem 2012-03-27 16:30:09 -07:00
Makefile remoteproc/rpmsg: new subsystem 2012-03-27 16:30:09 -07:00