]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'akpm' (Andrew's patch-bomb)
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Apr 2012 22:30:34 +0000 (15:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Apr 2012 22:30:34 +0000 (15:30 -0700)
Merge batch of fixes from Andrew Morton:
 "The simple_open() cleanup was held back while I wanted for laggards to
  merge things.

  I still need to send a few checkpoint/restore patches.  I've been
  wobbly about merging them because I'm wobbly about the overall
  prospects for success of the project.  But after speaking with Pavel
  at the LSF conference, it sounds like they're further toward
  completion than I feared - apparently davem is at the "has stopped
  complaining" stage regarding the net changes.  So I need to go back
  and re-review those patchs and their (lengthy) discussion."

* emailed from Andrew Morton <akpm@linux-foundation.org>: (16 patches)
  memcg swap: use mem_cgroup_uncharge_swap fix
  backlight: add driver for DA9052/53 PMIC v1
  C6X: use set_current_blocked() and block_sigmask()
  MAINTAINERS: add entry for sparse checker
  MAINTAINERS: fix REMOTEPROC F: typo
  alpha: use set_current_blocked() and block_sigmask()
  simple_open: automatically convert to simple_open()
  scripts/coccinelle/api/simple_open.cocci: semantic patch for simple_open()
  libfs: add simple_open()
  hugetlbfs: remove unregister_filesystem() when initializing module
  drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callback
  fs/xattr.c:setxattr(): improve handling of allocation failures
  fs/xattr.c:listxattr(): fall back to vmalloc() if kmalloc() failed
  fs/xattr.c: suppress page allocation failure warnings from sys_listxattr()
  sysrq: use SEND_SIG_FORCED instead of force_sig()
  proc: fix mount -t proc -o AAA

78 files changed:
MAINTAINERS
arch/alpha/kernel/signal.c
arch/arm/mach-msm/smd_debug.c
arch/c6x/kernel/signal.c
arch/x86/kernel/kdebugfs.c
drivers/acpi/ec_sys.c
drivers/base/regmap/regmap-debugfs.c
drivers/bluetooth/btmrvl_debugfs.c
drivers/char/virtio_console.c
drivers/dma/coh901318.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/hid/hid-picolcd.c
drivers/hid/hid-wiimote-debug.c
drivers/idle/i7300_idle.c
drivers/iommu/omap-iommu-debug.c
drivers/mfd/aat2870-core.c
drivers/mfd/ab3100-core.c
drivers/misc/ibmasm/ibmasmfs.c
drivers/mtd/ubi/debug.c
drivers/net/caif/caif_spi.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/wimax/i2400m/debugfs.c
drivers/net/wireless/ath/ath5k/debug.c
drivers/net/wireless/ath/ath6kl/debug.c
drivers/net/wireless/ath/ath9k/debug.c
drivers/net/wireless/ath/ath9k/dfs_debug.c
drivers/net/wireless/ath/ath9k/htc_drv_debug.c
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/ath/carl9170/debug.c
drivers/net/wireless/b43/debugfs.c
drivers/net/wireless/b43legacy/debugfs.c
drivers/net/wireless/iwlegacy/3945-rs.c
drivers/net/wireless/iwlegacy/4965-rs.c
drivers/net/wireless/iwlegacy/debug.c
drivers/net/wireless/iwlwifi/iwl-agn-rs.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
drivers/net/wireless/iwmc3200wifi/debugfs.c
drivers/net/wireless/iwmc3200wifi/sdio.c
drivers/net/wireless/libertas/debugfs.c
drivers/net/wireless/mwifiex/debugfs.c
drivers/net/wireless/wl1251/debugfs.c
drivers/net/wireless/wl12xx/debugfs.c
drivers/oprofile/oprofilefs.c
drivers/remoteproc/remoteproc_debugfs.c
drivers/rtc/rtc-88pm860x.c
drivers/scsi/lpfc/lpfc_debugfs.c
drivers/spi/spi-dw.c
drivers/tty/serial/mfd.c
drivers/tty/serial/pch_uart.c
drivers/tty/sysrq.c
drivers/usb/core/inode.c
drivers/usb/host/ehci-dbg.c
drivers/uwb/uwb-debug.c
drivers/video/backlight/Kconfig
drivers/video/backlight/Makefile
drivers/video/backlight/da9052_bl.c [new file with mode: 0644]
fs/debugfs/file.c
fs/dlm/debug_fs.c
fs/hugetlbfs/inode.c
fs/libfs.c
fs/proc/root.c
fs/pstore/inode.c
fs/xattr.c
include/linux/fs.h
include/linux/swap.h
kernel/trace/blktrace.c
net/mac80211/debugfs.c
net/mac80211/debugfs.h
net/mac80211/debugfs_key.c
net/mac80211/debugfs_netdev.c
net/mac80211/debugfs_sta.c
net/mac80211/rate.c
net/wireless/debugfs.c
scripts/coccinelle/api/simple_open.cocci [new file with mode: 0644]
sound/soc/imx/imx-audmux.c
sound/soc/soc-core.c
sound/soc/soc-dapm.c

index 962232d627812799b0d4c537c00e62f58bf47df4..3e25ba82e0fa578ce0dfbbb6d6f8f63bb083b29c 100644 (file)
@@ -5637,7 +5637,7 @@ M:        Ohad Ben-Cohen <ohad@wizery.com>
 S:     Maintained
 F:     drivers/remoteproc/
 F:     Documentation/remoteproc.txt
-F:     include/linux/remoteproc.txt
+F:     include/linux/remoteproc.h
 
 RFKILL
 M:     Johannes Berg <johannes@sipsolutions.net>
@@ -6287,6 +6287,15 @@ F:       drivers/tty/serial/sunsu.c
 F:     drivers/tty/serial/sunzilog.c
 F:     drivers/tty/serial/sunzilog.h
 
+SPARSE CHECKER
+M:     "Christopher Li" <sparse@chrisli.org>
+L:     linux-sparse@vger.kernel.org
+W:     https://sparse.wiki.kernel.org/
+T:     git git://git.kernel.org/pub/scm/devel/sparse/sparse.git
+T:     git git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git
+S:     Maintained
+F:     include/linux/compiler.h
+
 SPEAR PLATFORM SUPPORT
 M:     Viresh Kumar <viresh.kumar@st.com>
 L:     spear-devel@list.st.com
index 6f7feb5db27193f33e24e962e4d1be257d8464ef..35f2ef44de12629cfa166cef50f23b5e72b365cb 100644 (file)
@@ -120,12 +120,13 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
  */
 SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
 {
-       mask &= _BLOCKABLE;
-       spin_lock_irq(&current->sighand->siglock);
+       sigset_t blocked;
+
        current->saved_sigmask = current->blocked;
-       siginitset(&current->blocked, mask);
-       recalc_sigpending();
-       spin_unlock_irq(&current->sighand->siglock);
+
+       mask &= _BLOCKABLE;
+       siginitset(&blocked, mask);
+       set_current_blocked(&blocked);
 
        current->state = TASK_INTERRUPTIBLE;
        schedule();
@@ -238,10 +239,7 @@ do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
                goto give_sigsegv;
 
        sigdelsetmask(&set, ~_BLOCKABLE);
-       spin_lock_irq(&current->sighand->siglock);
-       current->blocked = set;
-       recalc_sigpending();
-       spin_unlock_irq(&current->sighand->siglock);
+       set_current_blocked(&set);
 
        if (restore_sigcontext(sc, regs, sw))
                goto give_sigsegv;
@@ -276,10 +274,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
                goto give_sigsegv;
 
        sigdelsetmask(&set, ~_BLOCKABLE);
-       spin_lock_irq(&current->sighand->siglock);
-       current->blocked = set;
-       recalc_sigpending();
-       spin_unlock_irq(&current->sighand->siglock);
+       set_current_blocked(&set);
 
        if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
                goto give_sigsegv;
@@ -501,14 +496,8 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
        else
                ret = setup_frame(sig, ka, oldset, regs, sw);
 
-       if (ret == 0) {
-               spin_lock_irq(&current->sighand->siglock);
-               sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
-               if (!(ka->sa.sa_flags & SA_NODEFER)) 
-                       sigaddset(&current->blocked,sig);
-               recalc_sigpending();
-               spin_unlock_irq(&current->sighand->siglock);
-       }
+       if (ret == 0)
+               block_sigmask(ka, sig);
 
        return ret;
 }
index 0c56a5aaf588f18c9b2e311620752137c2e83481..c56df9e932aec303aca92252040fe2d9344b5391 100644 (file)
@@ -203,15 +203,9 @@ static ssize_t debug_read(struct file *file, char __user *buf,
        return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize);
 }
 
-static int debug_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static const struct file_operations debug_ops = {
        .read = debug_read,
-       .open = debug_open,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
index 304f675826e93a249595ec65d5c81bb5629a9d85..3b5a0509998994549a80d72ef440b71c1934f2cf 100644 (file)
@@ -85,10 +85,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs)
                goto badframe;
 
        sigdelsetmask(&set, ~_BLOCKABLE);
-       spin_lock_irq(&current->sighand->siglock);
-       current->blocked = set;
-       recalc_sigpending();
-       spin_unlock_irq(&current->sighand->siglock);
+       set_current_blocked(&set);
 
        if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
                goto badframe;
@@ -279,15 +276,8 @@ static int handle_signal(int sig,
 
        /* Set up the stack frame */
        ret = setup_rt_frame(sig, ka, info, oldset, regs);
-       if (ret == 0) {
-               spin_lock_irq(&current->sighand->siglock);
-               sigorsets(&current->blocked, &current->blocked,
-                         &ka->sa.sa_mask);
-               if (!(ka->sa.sa_flags & SA_NODEFER))
-                       sigaddset(&current->blocked, sig);
-               recalc_sigpending();
-               spin_unlock_irq(&current->sighand->siglock);
-       }
+       if (ret == 0)
+               block_sigmask(ka, sig);
 
        return ret;
 }
index 90fcf62854bbac679eec40879db54df2ed6d09b5..1d5d31ea686be2aaedb2790637674cc0c0fec56b 100644 (file)
@@ -68,16 +68,9 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf,
        return count;
 }
 
-static int setup_data_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-
-       return 0;
-}
-
 static const struct file_operations fops_setup_data = {
        .read           = setup_data_read,
-       .open           = setup_data_open,
+       .open           = simple_open,
        .llseek         = default_llseek,
 };
 
index b258cab9061ced6765fc7dda2f81c70eb9511a83..7586544fddb41b9cc1761a294dc57f79245d6286 100644 (file)
@@ -27,12 +27,6 @@ MODULE_PARM_DESC(write_support, "Dangerous, reboot and removal of battery may "
 
 static struct dentry *acpi_ec_debugfs_dir;
 
-static int acpi_ec_open_io(struct inode *i, struct file *f)
-{
-       f->private_data = i->i_private;
-       return 0;
-}
-
 static ssize_t acpi_ec_read_io(struct file *f, char __user *buf,
                               size_t count, loff_t *off)
 {
@@ -95,7 +89,7 @@ static ssize_t acpi_ec_write_io(struct file *f, const char __user *buf,
 
 static const struct file_operations acpi_ec_io_ops = {
        .owner = THIS_MODULE,
-       .open  = acpi_ec_open_io,
+       .open  = simple_open,
        .read  = acpi_ec_read_io,
        .write = acpi_ec_write_io,
        .llseek = default_llseek,
index 58517a5dac1360b96b0779c0724d12e926d11c77..251eb70f83e7c0f626f6fd73ba86ec40e76d339f 100644 (file)
@@ -27,12 +27,6 @@ static size_t regmap_calc_reg_len(int max_val, char *buf, size_t buf_size)
        return strlen(buf);
 }
 
-static int regmap_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t regmap_name_read_file(struct file *file,
                                     char __user *user_buf, size_t count,
                                     loff_t *ppos)
@@ -57,7 +51,7 @@ static ssize_t regmap_name_read_file(struct file *file,
 }
 
 static const struct file_operations regmap_name_fops = {
-       .open = regmap_open_file,
+       .open = simple_open,
        .read = regmap_name_read_file,
        .llseek = default_llseek,
 };
@@ -174,7 +168,7 @@ static ssize_t regmap_map_write_file(struct file *file,
 #endif
 
 static const struct file_operations regmap_map_fops = {
-       .open = regmap_open_file,
+       .open = simple_open,
        .read = regmap_map_read_file,
        .write = regmap_map_write_file,
        .llseek = default_llseek,
@@ -243,7 +237,7 @@ out:
 }
 
 static const struct file_operations regmap_access_fops = {
-       .open = regmap_open_file,
+       .open = simple_open,
        .read = regmap_access_read_file,
        .llseek = default_llseek,
 };
index 6c20bbb54b71a8e51038f4ad84a59157d489dde0..428dbb7574bd75aa43d84ba5af353a134d1abfd3 100644 (file)
@@ -45,12 +45,6 @@ struct btmrvl_debugfs_data {
        struct dentry *txdnldready;
 };
 
-static int btmrvl_open_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t btmrvl_hscfgcmd_write(struct file *file,
                        const char __user *ubuf, size_t count, loff_t *ppos)
 {
@@ -93,7 +87,7 @@ static ssize_t btmrvl_hscfgcmd_read(struct file *file, char __user *userbuf,
 static const struct file_operations btmrvl_hscfgcmd_fops = {
        .read   = btmrvl_hscfgcmd_read,
        .write  = btmrvl_hscfgcmd_write,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -134,7 +128,7 @@ static ssize_t btmrvl_psmode_read(struct file *file, char __user *userbuf,
 static const struct file_operations btmrvl_psmode_fops = {
        .read   = btmrvl_psmode_read,
        .write  = btmrvl_psmode_write,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -180,7 +174,7 @@ static ssize_t btmrvl_pscmd_read(struct file *file, char __user *userbuf,
 static const struct file_operations btmrvl_pscmd_fops = {
        .read = btmrvl_pscmd_read,
        .write = btmrvl_pscmd_write,
-       .open = btmrvl_open_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -221,7 +215,7 @@ static ssize_t btmrvl_gpiogap_read(struct file *file, char __user *userbuf,
 static const struct file_operations btmrvl_gpiogap_fops = {
        .read   = btmrvl_gpiogap_read,
        .write  = btmrvl_gpiogap_write,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -265,7 +259,7 @@ static ssize_t btmrvl_hscmd_read(struct file *file, char __user *userbuf,
 static const struct file_operations btmrvl_hscmd_fops = {
        .read   = btmrvl_hscmd_read,
        .write  = btmrvl_hscmd_write,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -305,7 +299,7 @@ static ssize_t btmrvl_hsmode_read(struct file *file, char __user * userbuf,
 static const struct file_operations btmrvl_hsmode_fops = {
        .read   = btmrvl_hsmode_read,
        .write  = btmrvl_hsmode_write,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -323,7 +317,7 @@ static ssize_t btmrvl_curpsmode_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations btmrvl_curpsmode_fops = {
        .read   = btmrvl_curpsmode_read,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -341,7 +335,7 @@ static ssize_t btmrvl_psstate_read(struct file *file, char __user * userbuf,
 
 static const struct file_operations btmrvl_psstate_fops = {
        .read   = btmrvl_psstate_read,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -359,7 +353,7 @@ static ssize_t btmrvl_hsstate_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations btmrvl_hsstate_fops = {
        .read   = btmrvl_hsstate_read,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
@@ -378,7 +372,7 @@ static ssize_t btmrvl_txdnldready_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations btmrvl_txdnldready_fops = {
        .read   = btmrvl_txdnldready_read,
-       .open   = btmrvl_open_generic,
+       .open   = simple_open,
        .llseek = default_llseek,
 };
 
index b58b5618706588936ebcf7a028bde7dba8f616c1..ddf86b6500b7d705ef5853405c265ef5b2f19868 100644 (file)
@@ -1038,12 +1038,6 @@ static struct attribute_group port_attribute_group = {
        .attrs = port_sysfs_entries,
 };
 
-static int debugfs_open(struct inode *inode, struct file *filp)
-{
-       filp->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t debugfs_read(struct file *filp, char __user *ubuf,
                            size_t count, loff_t *offp)
 {
@@ -1087,7 +1081,7 @@ static ssize_t debugfs_read(struct file *filp, char __user *ubuf,
 
 static const struct file_operations port_debugfs_ops = {
        .owner = THIS_MODULE,
-       .open  = debugfs_open,
+       .open  = simple_open,
        .read  = debugfs_read,
 };
 
index dc89455f5550c90ffec150d16f3d0e06e5614ee0..750925f9638bab656b39ccff65bed7dbdbee405c 100644 (file)
@@ -104,13 +104,6 @@ static void coh901318_list_print(struct coh901318_chan *cohc,
 static struct coh901318_base *debugfs_dma_base;
 static struct dentry *dma_dentry;
 
-static int coh901318_debugfs_open(struct inode *inode, struct file *file)
-{
-
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static int coh901318_debugfs_read(struct file *file, char __user *buf,
                                  size_t count, loff_t *f_pos)
 {
@@ -158,7 +151,7 @@ static int coh901318_debugfs_read(struct file *file, char __user *buf,
 
 static const struct file_operations coh901318_debugfs_status_operations = {
        .owner          = THIS_MODULE,
-       .open           = coh901318_debugfs_open,
+       .open           = simple_open,
        .read           = coh901318_debugfs_read,
        .llseek         = default_llseek,
 };
index fdb7ccefffbdfc77a1dc7328c2ae727e371a7bad..b505b70dba05b98a514e35aeba96044ca03e2843 100644 (file)
@@ -1502,14 +1502,6 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
        return 0;
 }
 
-static int
-i915_debugfs_common_open(struct inode *inode,
-                        struct file *filp)
-{
-       filp->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t
 i915_wedged_read(struct file *filp,
                 char __user *ubuf,
@@ -1560,7 +1552,7 @@ i915_wedged_write(struct file *filp,
 
 static const struct file_operations i915_wedged_fops = {
        .owner = THIS_MODULE,
-       .open = i915_debugfs_common_open,
+       .open = simple_open,
        .read = i915_wedged_read,
        .write = i915_wedged_write,
        .llseek = default_llseek,
@@ -1622,7 +1614,7 @@ i915_max_freq_write(struct file *filp,
 
 static const struct file_operations i915_max_freq_fops = {
        .owner = THIS_MODULE,
-       .open = i915_debugfs_common_open,
+       .open = simple_open,
        .read = i915_max_freq_read,
        .write = i915_max_freq_write,
        .llseek = default_llseek,
@@ -1693,7 +1685,7 @@ i915_cache_sharing_write(struct file *filp,
 
 static const struct file_operations i915_cache_sharing_fops = {
        .owner = THIS_MODULE,
-       .open = i915_debugfs_common_open,
+       .open = simple_open,
        .read = i915_cache_sharing_read,
        .write = i915_cache_sharing_write,
        .llseek = default_llseek,
index 12f9777c385d4038825d2fddcd59a18182e13b3c..45c3433f798699ec6749cee885a2b78d490e2b21 100644 (file)
@@ -1525,12 +1525,6 @@ static const struct file_operations picolcd_debug_reset_fops = {
 /*
  * The "eeprom" file
  */
-static int picolcd_debug_eeprom_open(struct inode *i, struct file *f)
-{
-       f->private_data = i->i_private;
-       return 0;
-}
-
 static ssize_t picolcd_debug_eeprom_read(struct file *f, char __user *u,
                size_t s, loff_t *off)
 {
@@ -1618,7 +1612,7 @@ static ssize_t picolcd_debug_eeprom_write(struct file *f, const char __user *u,
  */
 static const struct file_operations picolcd_debug_eeprom_fops = {
        .owner    = THIS_MODULE,
-       .open     = picolcd_debug_eeprom_open,
+       .open     = simple_open,
        .read     = picolcd_debug_eeprom_read,
        .write    = picolcd_debug_eeprom_write,
        .llseek   = generic_file_llseek,
@@ -1627,12 +1621,6 @@ static const struct file_operations picolcd_debug_eeprom_fops = {
 /*
  * The "flash" file
  */
-static int picolcd_debug_flash_open(struct inode *i, struct file *f)
-{
-       f->private_data = i->i_private;
-       return 0;
-}
-
 /* record a flash address to buf (bounds check to be done by caller) */
 static int _picolcd_flash_setaddr(struct picolcd_data *data, u8 *buf, long off)
 {
@@ -1817,7 +1805,7 @@ static ssize_t picolcd_debug_flash_write(struct file *f, const char __user *u,
  */
 static const struct file_operations picolcd_debug_flash_fops = {
        .owner    = THIS_MODULE,
-       .open     = picolcd_debug_flash_open,
+       .open     = simple_open,
        .read     = picolcd_debug_flash_read,
        .write    = picolcd_debug_flash_write,
        .llseek   = generic_file_llseek,
index 17dabc1f339e93ee9eff1221a433b03784dea3c7..eec329197c160e6739ccf1cbb0a24adc766b15ee 100644 (file)
@@ -23,12 +23,6 @@ struct wiimote_debug {
        struct dentry *drm;
 };
 
-static int wiidebug_eeprom_open(struct inode *i, struct file *f)
-{
-       f->private_data = i->i_private;
-       return 0;
-}
-
 static ssize_t wiidebug_eeprom_read(struct file *f, char __user *u, size_t s,
                                                                loff_t *off)
 {
@@ -83,7 +77,7 @@ static ssize_t wiidebug_eeprom_read(struct file *f, char __user *u, size_t s,
 
 static const struct file_operations wiidebug_eeprom_fops = {
        .owner = THIS_MODULE,
-       .open = wiidebug_eeprom_open,
+       .open = simple_open,
        .read = wiidebug_eeprom_read,
        .llseek = generic_file_llseek,
 };
index c976285d313eea4a6b5e2916c73a56350eeb3074..fa080ebd568f83fcaf821a7650e31983e8221300 100644 (file)
@@ -516,12 +516,6 @@ static struct notifier_block i7300_idle_nb = {
 
 MODULE_DEVICE_TABLE(pci, pci_tbl);
 
-int stats_open_generic(struct inode *inode, struct file *fp)
-{
-       fp->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t stats_read_ul(struct file *fp, char __user *ubuf, size_t count,
                                loff_t *off)
 {
@@ -534,7 +528,7 @@ static ssize_t stats_read_ul(struct file *fp, char __user *ubuf, size_t count,
 }
 
 static const struct file_operations idle_fops = {
-       .open   = stats_open_generic,
+       .open   = simple_open,
        .read   = stats_read_ul,
        .llseek = default_llseek,
 };
index 103dbd92e2563ac55116b335fa35cb84f73fe7a8..f55fc5dfbadcfe420030cfd8b6632b98b48c2601 100644 (file)
@@ -323,15 +323,9 @@ err_out:
        return count;
 }
 
-static int debug_open_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 #define DEBUG_FOPS(name)                                               \
        static const struct file_operations debug_##name##_fops = {     \
-               .open = debug_open_generic,                             \
+               .open = simple_open,                                    \
                .read = debug_read_##name,                              \
                .write = debug_write_##name,                            \
                .llseek = generic_file_llseek,                          \
@@ -339,7 +333,7 @@ static int debug_open_generic(struct inode *inode, struct file *file)
 
 #define DEBUG_FOPS_RO(name)                                            \
        static const struct file_operations debug_##name##_fops = {     \
-               .open = debug_open_generic,                             \
+               .open = simple_open,                                    \
                .read = debug_read_##name,                              \
                .llseek = generic_file_llseek,                          \
        };
index 3aa36eb5c79bcf769616013cd3176ed04af500bc..44a3fdbadef40df1e09b12884f44caa46b76f0ac 100644 (file)
@@ -262,13 +262,6 @@ static ssize_t aat2870_dump_reg(struct aat2870_data *aat2870, char *buf)
        return count;
 }
 
-static int aat2870_reg_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-
-       return 0;
-}
-
 static ssize_t aat2870_reg_read_file(struct file *file, char __user *user_buf,
                                     size_t count, loff_t *ppos)
 {
@@ -330,7 +323,7 @@ static ssize_t aat2870_reg_write_file(struct file *file,
 }
 
 static const struct file_operations aat2870_reg_fops = {
-       .open = aat2870_reg_open_file,
+       .open = simple_open,
        .read = aat2870_reg_read_file,
        .write = aat2870_reg_write_file,
 };
index 60107ee166fc4852da4bd63835913fca96becac6..1efad20fb1757523713359ff5af65f3d13ca4302 100644 (file)
@@ -483,12 +483,6 @@ struct ab3100_get_set_reg_priv {
        bool mode;
 };
 
-static int ab3100_get_set_reg_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t ab3100_get_set_reg(struct file *file,
                                  const char __user *user_buf,
                                  size_t count, loff_t *ppos)
@@ -583,7 +577,7 @@ static ssize_t ab3100_get_set_reg(struct file *file,
 }
 
 static const struct file_operations ab3100_get_set_reg_fops = {
-       .open = ab3100_get_set_reg_open_file,
+       .open = simple_open,
        .write = ab3100_get_set_reg,
        .llseek = noop_llseek,
 };
index 1c034b80d4082c4c3e328403749c03b8e83bdada..6673e578b3e9a00bce4a949cc19495359c66ebda 100644 (file)
@@ -500,12 +500,6 @@ static ssize_t r_heartbeat_file_write(struct file *file, const char __user *buf,
        return 1;
 }
 
-static int remote_settings_file_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static int remote_settings_file_close(struct inode *inode, struct file *file)
 {
        return 0;
@@ -600,7 +594,7 @@ static const struct file_operations r_heartbeat_fops = {
 };
 
 static const struct file_operations remote_settings_fops = {
-       .open =         remote_settings_file_open,
+       .open =         simple_open,
        .release =      remote_settings_file_close,
        .read =         remote_settings_file_read,
        .write =        remote_settings_file_write,
index e2cdebf40840e4f3630e6a7bf9868ab46781ab74..61af9bb560ab6777cd90ea5125790f38ee6139a9 100644 (file)
@@ -386,19 +386,11 @@ out:
        return count;
 }
 
-static int default_open(struct inode *inode, struct file *file)
-{
-       if (inode->i_private)
-               file->private_data = inode->i_private;
-
-       return 0;
-}
-
 /* File operations for all UBI debugfs files */
 static const struct file_operations dfs_fops = {
        .read   = dfs_file_read,
        .write  = dfs_file_write,
-       .open   = default_open,
+       .open   = simple_open,
        .llseek = no_llseek,
        .owner  = THIS_MODULE,
 };
index 96391c36fa74c77a66b47add6cf188f069fcce0a..b71ce9bf0afb7297df000208492e420ff9bd58ad 100644 (file)
@@ -127,12 +127,6 @@ static inline void dev_debugfs_rem(struct cfspi *cfspi)
        debugfs_remove(cfspi->dbgfs_dir);
 }
 
-static int dbgfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t dbgfs_state(struct file *file, char __user *user_buf,
                           size_t count, loff_t *ppos)
 {
@@ -243,13 +237,13 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf,
 }
 
 static const struct file_operations dbgfs_state_fops = {
-       .open = dbgfs_open,
+       .open = simple_open,
        .read = dbgfs_state,
        .owner = THIS_MODULE
 };
 
 static const struct file_operations dbgfs_frame_fops = {
-       .open = dbgfs_open,
+       .open = simple_open,
        .read = dbgfs_frame,
        .owner = THIS_MODULE
 };
index 05ff076af06d92fe024199cba9f68f6e1847b299..b126b98065a9835dd882326bafafa6e80cb836f9 100644 (file)
@@ -2000,13 +2000,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
 /*
  * debugfs support
  */
-
-static int mem_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
                        loff_t *ppos)
 {
@@ -2050,7 +2043,7 @@ static ssize_t mem_read(struct file *file, char __user *buf, size_t count,
 
 static const struct file_operations mem_debugfs_fops = {
        .owner   = THIS_MODULE,
-       .open    = mem_open,
+       .open    = simple_open,
        .read    = mem_read,
        .llseek  = default_llseek,
 };
index 129ba36bd04d6a52c205aa60c44d042c2003401b..4b66ab1d0e5cf8f9e0fb9511c145e0049585172f 100644 (file)
@@ -53,17 +53,6 @@ struct dentry *debugfs_create_netdev_queue_stopped(
                                   &fops_netdev_queue_stopped);
 }
 
-
-/*
- * inode->i_private has the @data argument to debugfs_create_file()
- */
-static
-int i2400m_stats_open(struct inode *inode, struct file *filp)
-{
-       filp->private_data = inode->i_private;
-       return 0;
-}
-
 /*
  * We don't allow partial reads of this file, as then the reader would
  * get weirdly confused data as it is updated.
@@ -117,7 +106,7 @@ ssize_t i2400m_rx_stats_write(struct file *filp, const char __user *buffer,
 static
 const struct file_operations i2400m_rx_stats_fops = {
        .owner =        THIS_MODULE,
-       .open =         i2400m_stats_open,
+       .open =         simple_open,
        .read =         i2400m_rx_stats_read,
        .write =        i2400m_rx_stats_write,
        .llseek =       default_llseek,
@@ -170,7 +159,7 @@ ssize_t i2400m_tx_stats_write(struct file *filp, const char __user *buffer,
 static
 const struct file_operations i2400m_tx_stats_fops = {
        .owner =        THIS_MODULE,
-       .open =         i2400m_stats_open,
+       .open =         simple_open,
        .read =         i2400m_tx_stats_read,
        .write =        i2400m_tx_stats_write,
        .llseek =       default_llseek,
index 8c5ce8b0c7346873a64c6ee9e8f358a2d5a565c6..e5e8f45d86acdb6c74faf067465e783bae96cf0e 100644 (file)
@@ -71,13 +71,6 @@ static unsigned int ath5k_debug;
 module_param_named(debug, ath5k_debug, uint, 0);
 
 
-static int ath5k_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
-
 /* debugfs: registers */
 
 struct reg {
@@ -265,7 +258,7 @@ static ssize_t write_file_beacon(struct file *file,
 static const struct file_operations fops_beacon = {
        .read = read_file_beacon,
        .write = write_file_beacon,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -285,7 +278,7 @@ static ssize_t write_file_reset(struct file *file,
 
 static const struct file_operations fops_reset = {
        .write = write_file_reset,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = noop_llseek,
 };
@@ -365,7 +358,7 @@ static ssize_t write_file_debug(struct file *file,
 static const struct file_operations fops_debug = {
        .read = read_file_debug,
        .write = write_file_debug,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -477,7 +470,7 @@ static ssize_t write_file_antenna(struct file *file,
 static const struct file_operations fops_antenna = {
        .read = read_file_antenna,
        .write = write_file_antenna,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -532,7 +525,7 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_misc = {
        .read = read_file_misc,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
 };
 
@@ -647,7 +640,7 @@ static ssize_t write_file_frameerrors(struct file *file,
 static const struct file_operations fops_frameerrors = {
        .read = read_file_frameerrors,
        .write = write_file_frameerrors,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -810,7 +803,7 @@ static ssize_t write_file_ani(struct file *file,
 static const struct file_operations fops_ani = {
        .read = read_file_ani,
        .write = write_file_ani,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -881,7 +874,7 @@ static ssize_t write_file_queue(struct file *file,
 static const struct file_operations fops_queue = {
        .read = read_file_queue,
        .write = write_file_queue,
-       .open = ath5k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
index 552adb3f80d07e85d963e65447096dae4233eaf2..d01403a263ff66b935e70fcc04f23d2f971b0a10 100644 (file)
@@ -217,12 +217,6 @@ void dump_cred_dist_stats(struct htc_target *target)
                   target->credit_info->cur_free_credits);
 }
 
-static int ath6kl_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 void ath6kl_debug_war(struct ath6kl *ar, enum ath6kl_war war)
 {
        switch (war) {
@@ -263,7 +257,7 @@ static ssize_t read_file_war_stats(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_war_stats = {
        .read = read_file_war_stats,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -488,7 +482,7 @@ static ssize_t ath6kl_fwlog_mask_write(struct file *file,
 }
 
 static const struct file_operations fops_fwlog_mask = {
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .read = ath6kl_fwlog_mask_read,
        .write = ath6kl_fwlog_mask_write,
        .owner = THIS_MODULE,
@@ -634,7 +628,7 @@ static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_tgt_stats = {
        .read = read_file_tgt_stats,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -699,7 +693,7 @@ static ssize_t read_file_credit_dist_stats(struct file *file,
 
 static const struct file_operations fops_credit_dist_stats = {
        .read = read_file_credit_dist_stats,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -802,7 +796,7 @@ static ssize_t ath6kl_endpoint_stats_write(struct file *file,
 }
 
 static const struct file_operations fops_endpoint_stats = {
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .read = ath6kl_endpoint_stats_read,
        .write = ath6kl_endpoint_stats_write,
        .owner = THIS_MODULE,
@@ -875,7 +869,7 @@ static ssize_t ath6kl_regread_write(struct file *file,
 static const struct file_operations fops_diag_reg_read = {
        .read = ath6kl_regread_read,
        .write = ath6kl_regread_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -999,7 +993,7 @@ static ssize_t ath6kl_lrssi_roam_read(struct file *file,
 static const struct file_operations fops_lrssi_roam_threshold = {
        .read = ath6kl_lrssi_roam_read,
        .write = ath6kl_lrssi_roam_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1061,7 +1055,7 @@ static ssize_t ath6kl_regwrite_write(struct file *file,
 static const struct file_operations fops_diag_reg_write = {
        .read = ath6kl_regwrite_read,
        .write = ath6kl_regwrite_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1166,7 +1160,7 @@ static ssize_t ath6kl_roam_table_read(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_roam_table = {
        .read = ath6kl_roam_table_read,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1204,7 +1198,7 @@ static ssize_t ath6kl_force_roam_write(struct file *file,
 
 static const struct file_operations fops_force_roam = {
        .write = ath6kl_force_roam_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1244,7 +1238,7 @@ static ssize_t ath6kl_roam_mode_write(struct file *file,
 
 static const struct file_operations fops_roam_mode = {
        .write = ath6kl_roam_mode_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1286,7 +1280,7 @@ static ssize_t ath6kl_keepalive_write(struct file *file,
 }
 
 static const struct file_operations fops_keepalive = {
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .read = ath6kl_keepalive_read,
        .write = ath6kl_keepalive_write,
        .owner = THIS_MODULE,
@@ -1331,7 +1325,7 @@ static ssize_t ath6kl_disconnect_timeout_write(struct file *file,
 }
 
 static const struct file_operations fops_disconnect_timeout = {
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .read = ath6kl_disconnect_timeout_read,
        .write = ath6kl_disconnect_timeout_write,
        .owner = THIS_MODULE,
@@ -1512,7 +1506,7 @@ static ssize_t ath6kl_create_qos_write(struct file *file,
 
 static const struct file_operations fops_create_qos = {
        .write = ath6kl_create_qos_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1560,7 +1554,7 @@ static ssize_t ath6kl_delete_qos_write(struct file *file,
 
 static const struct file_operations fops_delete_qos = {
        .write = ath6kl_delete_qos_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1593,7 +1587,7 @@ static ssize_t ath6kl_bgscan_int_write(struct file *file,
 
 static const struct file_operations fops_bgscan_int = {
        .write = ath6kl_bgscan_int_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1651,7 +1645,7 @@ static ssize_t ath6kl_listen_int_read(struct file *file,
 static const struct file_operations fops_listen_int = {
        .read = ath6kl_listen_int_read,
        .write = ath6kl_listen_int_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1711,7 +1705,7 @@ static ssize_t ath6kl_power_params_write(struct file *file,
 
 static const struct file_operations fops_power_params = {
        .write = ath6kl_power_params_write,
-       .open = ath6kl_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
index 35d1c8e91d1c161140ec1513b5f0eaff0114f474..ff47b32ecaf483fd87b99bf89dbc75fe6e325fcd 100644 (file)
 #define REG_READ_D(_ah, _reg) \
        ath9k_hw_common(_ah)->ops->read((_ah), (_reg))
 
-static int ath9k_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 
 static ssize_t ath9k_debugfs_read_buf(struct file *file, char __user *user_buf,
                                      size_t count, loff_t *ppos)
@@ -83,7 +78,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf,
 static const struct file_operations fops_debug = {
        .read = read_file_debug,
        .write = write_file_debug,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -129,7 +124,7 @@ static ssize_t write_file_tx_chainmask(struct file *file, const char __user *use
 static const struct file_operations fops_tx_chainmask = {
        .read = read_file_tx_chainmask,
        .write = write_file_tx_chainmask,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -172,7 +167,7 @@ static ssize_t write_file_rx_chainmask(struct file *file, const char __user *use
 static const struct file_operations fops_rx_chainmask = {
        .read = read_file_rx_chainmask,
        .write = write_file_rx_chainmask,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -223,7 +218,7 @@ static ssize_t write_file_disable_ani(struct file *file,
 static const struct file_operations fops_disable_ani = {
        .read = read_file_disable_ani,
        .write = write_file_disable_ani,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -324,7 +319,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_dma = {
        .read = read_file_dma,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -446,7 +441,7 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_interrupt = {
        .read = read_file_interrupt,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -852,28 +847,28 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
 
 static const struct file_operations fops_xmit = {
        .read = read_file_xmit,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
 
 static const struct file_operations fops_stations = {
        .read = read_file_stations,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
 
 static const struct file_operations fops_misc = {
        .read = read_file_misc,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
 
 static const struct file_operations fops_reset = {
        .read = read_file_reset,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1016,7 +1011,7 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
 
 static const struct file_operations fops_recv = {
        .read = read_file_recv,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1055,7 +1050,7 @@ static ssize_t write_file_regidx(struct file *file, const char __user *user_buf,
 static const struct file_operations fops_regidx = {
        .read = read_file_regidx,
        .write = write_file_regidx,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1102,7 +1097,7 @@ static ssize_t write_file_regval(struct file *file, const char __user *user_buf,
 static const struct file_operations fops_regval = {
        .read = read_file_regval,
        .write = write_file_regval,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1191,7 +1186,7 @@ static ssize_t read_file_dump_nfcal(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_dump_nfcal = {
        .read = read_file_dump_nfcal,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1219,7 +1214,7 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_base_eeprom = {
        .read = read_file_base_eeprom,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -1247,7 +1242,7 @@ static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_modal_eeprom = {
        .read = read_file_modal_eeprom,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
index 106d031d834a9aacef8f4b2f6c0ff8a81a707914..4364c103ed33df2de9e54c4254c82e6e2ec87fec 100644 (file)
@@ -60,16 +60,9 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
        return retval;
 }
 
-static int ath9k_dfs_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-
-       return 0;
-}
-
 static const struct file_operations fops_dfs_stats = {
        .read = read_file_dfs,
-       .open = ath9k_dfs_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
index d3ff33c71aa5bbd2074d4d64c2a92c41ab144c91..3035deb7a0cdcd5343c09733942bf0d56e5886a8 100644 (file)
 
 #include "htc.h"
 
-static int ath9k_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
                                       size_t count, loff_t *ppos)
 {
@@ -75,7 +69,7 @@ static ssize_t read_file_tgt_int_stats(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_tgt_int_stats = {
        .read = read_file_tgt_int_stats,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -145,7 +139,7 @@ static ssize_t read_file_tgt_tx_stats(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_tgt_tx_stats = {
        .read = read_file_tgt_tx_stats,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -191,7 +185,7 @@ static ssize_t read_file_tgt_rx_stats(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_tgt_rx_stats = {
        .read = read_file_tgt_rx_stats,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -243,7 +237,7 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_xmit = {
        .read = read_file_xmit,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -364,7 +358,7 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_recv = {
        .read = read_file_recv,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -399,7 +393,7 @@ static ssize_t read_file_slot(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_slot = {
        .read = read_file_slot,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -446,7 +440,7 @@ static ssize_t read_file_queue(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_queue = {
        .read = read_file_queue,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -487,7 +481,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf,
 static const struct file_operations fops_debug = {
        .read = read_file_debug,
        .write = write_file_debug,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -636,7 +630,7 @@ static ssize_t read_file_base_eeprom(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_base_eeprom = {
        .read = read_file_base_eeprom,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
@@ -917,7 +911,7 @@ static ssize_t read_file_modal_eeprom(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_modal_eeprom = {
        .read = read_file_modal_eeprom,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE,
        .llseek = default_llseek,
 };
index 4f848493fece320edb8d8ce45619fb4a5f09538a..08bb45532701125f69bd0e39c7e0defab15e531e 100644 (file)
@@ -1480,12 +1480,6 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
 
 #ifdef CONFIG_ATH9K_DEBUGFS
 
-static int ath9k_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
                                size_t count, loff_t *ppos)
 {
@@ -1553,7 +1547,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_rcstat = {
        .read = read_file_rcstat,
-       .open = ath9k_debugfs_open,
+       .open = simple_open,
        .owner = THIS_MODULE
 };
 
index 3c164226687f54ea74ca18a96e665eb921ae4774..93fe6003a493827dc61e0418607860c90de36d5d 100644 (file)
 #define ADD(buf, off, max, fmt, args...)                               \
        off += snprintf(&buf[off], max - off, fmt, ##args);
 
-static int carl9170_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 
 struct carl9170_debugfs_fops {
        unsigned int read_bufsize;
@@ -178,7 +173,7 @@ static const struct carl9170_debugfs_fops carl_debugfs_##name ##_ops = {\
        .attr = _attr,                                                  \
        .req_dev_state = _dstate,                                       \
        .fops = {                                                       \
-               .open   = carl9170_debugfs_open,                        \
+               .open   = simple_open,                                  \
                .read   = carl9170_debugfs_read,                        \
                .write  = carl9170_debugfs_write,                       \
                .owner  = THIS_MODULE                                   \
index e751fdee89b25fc39eb2d41009d8e9ca07e7448a..e807bd9306471772509b0f936391c5b609ed4cfa 100644 (file)
@@ -500,12 +500,6 @@ out:
 
 #undef fappend
 
-static int b43_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
                                size_t count, loff_t *ppos)
 {
@@ -624,7 +618,7 @@ out_unlock:
                .read   = _read,                                \
                .write  = _write,                               \
                .fops   = {                                     \
-                       .open   = b43_debugfs_open,             \
+                       .open   = simple_open,                  \
                        .read   = b43_debugfs_read,             \
                        .write  = b43_debugfs_write,            \
                        .llseek = generic_file_llseek,          \
index 5e28ad0d6d17f8a1c43401594a42f2b040bbdad5..1965edb765a288d090942d81f013710ba88c0677 100644 (file)
@@ -197,12 +197,6 @@ static int restart_write_file(struct b43legacy_wldev *dev, const char *buf, size
 
 #undef fappend
 
-static int b43legacy_debugfs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t b43legacy_debugfs_read(struct file *file, char __user *userbuf,
                                size_t count, loff_t *ppos)
 {
@@ -331,7 +325,7 @@ out_unlock:
                .read   = _read,                                \
                .write  = _write,                               \
                .fops   = {                                     \
-                       .open   = b43legacy_debugfs_open,               \
+                       .open   = simple_open,                          \
                        .read   = b43legacy_debugfs_read,               \
                        .write  = b43legacy_debugfs_write,              \
                        .llseek = generic_file_llseek,                  \
index 70bee1a4d87679e57cafdb01fa22968ec823f20e..4b10157d86864685e8f635d07b8795fbaf3ef16f 100644 (file)
@@ -821,12 +821,6 @@ out:
 }
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-static int
-il3945_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 
 static ssize_t
 il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
@@ -862,7 +856,7 @@ il3945_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
 
 static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
        .read = il3945_sta_dbgfs_stats_table_read,
-       .open = il3945_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
index d7e2856e41d3b0e90929d605096e9e40932f95ee..11ab1247fae1c841eedc4cf390be9eba167b987f 100644 (file)
@@ -2518,12 +2518,6 @@ il4965_rs_free_sta(void *il_r, struct ieee80211_sta *sta, void *il_sta)
 }
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-static int
-il4965_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 
 static void
 il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
@@ -2695,7 +2689,7 @@ il4965_rs_sta_dbgfs_scale_table_read(struct file *file, char __user *user_buf,
 static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
        .write = il4965_rs_sta_dbgfs_scale_table_write,
        .read = il4965_rs_sta_dbgfs_scale_table_read,
-       .open = il4965_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -2740,7 +2734,7 @@ il4965_rs_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
 
 static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
        .read = il4965_rs_sta_dbgfs_stats_table_read,
-       .open = il4965_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -2768,7 +2762,7 @@ il4965_rs_sta_dbgfs_rate_scale_data_read(struct file *file,
 
 static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = {
        .read = il4965_rs_sta_dbgfs_rate_scale_data_read,
-       .open = il4965_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
index 229849150aac0bb20e152b6a79b0658ebf3b18bb..eff26501d60a63407fba5b8cff66778d612df54e 100644 (file)
@@ -160,18 +160,12 @@ static ssize_t il_dbgfs_##name##_write(struct file *file,              \
                                        const char __user *user_buf,    \
                                        size_t count, loff_t *ppos);
 
-static int
-il_dbgfs_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 
 #define DEBUGFS_READ_FILE_OPS(name)                            \
        DEBUGFS_READ_FUNC(name);                                \
 static const struct file_operations il_dbgfs_##name##_ops = {  \
        .read = il_dbgfs_##name##_read,                         \
-       .open = il_dbgfs_open_file_generic,                     \
+       .open = simple_open,                                    \
        .llseek = generic_file_llseek,                          \
 };
 
@@ -179,7 +173,7 @@ static const struct file_operations il_dbgfs_##name##_ops = {       \
        DEBUGFS_WRITE_FUNC(name);                               \
 static const struct file_operations il_dbgfs_##name##_ops = {  \
        .write = il_dbgfs_##name##_write,                       \
-       .open = il_dbgfs_open_file_generic,                     \
+       .open = simple_open,                                    \
        .llseek = generic_file_llseek,                          \
 };
 
@@ -189,7 +183,7 @@ static const struct file_operations il_dbgfs_##name##_ops = {       \
 static const struct file_operations il_dbgfs_##name##_ops = {  \
        .write = il_dbgfs_##name##_write,                       \
        .read = il_dbgfs_##name##_read,                         \
-       .open = il_dbgfs_open_file_generic,                     \
+       .open = simple_open,                                    \
        .llseek = generic_file_llseek,                          \
 };
 
index 53f8c51cfcdb021d292caf5f911694413df42d4c..7e590b349dd7523f76db4c1ff235c53b5434d71b 100644 (file)
@@ -3083,11 +3083,6 @@ static void rs_free_sta(void *priv_r, struct ieee80211_sta *sta,
 }
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-static int open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
                             u32 *rate_n_flags, int index)
 {
@@ -3226,7 +3221,7 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
 static const struct file_operations rs_sta_dbgfs_scale_table_ops = {
        .write = rs_sta_dbgfs_scale_table_write,
        .read = rs_sta_dbgfs_scale_table_read,
-       .open = open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
@@ -3269,7 +3264,7 @@ static ssize_t rs_sta_dbgfs_stats_table_read(struct file *file,
 
 static const struct file_operations rs_sta_dbgfs_stats_table_ops = {
        .read = rs_sta_dbgfs_stats_table_read,
-       .open = open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -3295,7 +3290,7 @@ static ssize_t rs_sta_dbgfs_rate_scale_data_read(struct file *file,
 
 static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = {
        .read = rs_sta_dbgfs_rate_scale_data_read,
-       .open = open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
index b7b1c04f2fba4c7b449d8106de5471b6548c1d2c..2bbaebd99ad42a4a8c057838eead058088686dc0 100644 (file)
@@ -84,17 +84,11 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file,              \
                                        size_t count, loff_t *ppos);
 
 
-static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 #define DEBUGFS_READ_FILE_OPS(name)                                     \
        DEBUGFS_READ_FUNC(name);                                        \
 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
        .read = iwl_dbgfs_##name##_read,                                \
-       .open = iwl_dbgfs_open_file_generic,                            \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -102,7 +96,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = {          \
        DEBUGFS_WRITE_FUNC(name);                                       \
 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
        .write = iwl_dbgfs_##name##_write,                              \
-       .open = iwl_dbgfs_open_file_generic,                            \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -113,7 +107,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = {          \
 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
        .write = iwl_dbgfs_##name##_write,                              \
        .read = iwl_dbgfs_##name##_read,                                \
-       .open = iwl_dbgfs_open_file_generic,                            \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
index b4f796c82e1ec90ddf3a466960c242a49f99138f..4d7b30d3e64855e83b03d1cfaaa4391d6fa8b8d4 100644 (file)
@@ -1898,17 +1898,11 @@ static ssize_t iwl_dbgfs_##name##_write(struct file *file,              \
                                        size_t count, loff_t *ppos);
 
 
-static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 #define DEBUGFS_READ_FILE_OPS(name)                                    \
        DEBUGFS_READ_FUNC(name);                                        \
 static const struct file_operations iwl_dbgfs_##name##_ops = {         \
        .read = iwl_dbgfs_##name##_read,                                \
-       .open = iwl_dbgfs_open_file_generic,                            \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -1916,7 +1910,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = {            \
        DEBUGFS_WRITE_FUNC(name);                                       \
 static const struct file_operations iwl_dbgfs_##name##_ops = {          \
        .write = iwl_dbgfs_##name##_write,                              \
-       .open = iwl_dbgfs_open_file_generic,                            \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -1926,7 +1920,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = {          \
 static const struct file_operations iwl_dbgfs_##name##_ops = {         \
        .write = iwl_dbgfs_##name##_write,                              \
        .read = iwl_dbgfs_##name##_read,                                \
-       .open = iwl_dbgfs_open_file_generic,                            \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
index 87eef5773a02e35203319f53fa4ff1da58cdf60b..b6199d124bb9a5955ece37d4bdd0e808cb9c9cdd 100644 (file)
@@ -99,12 +99,6 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_iwm_dbg_modules,
                        iwm_debugfs_u32_read, iwm_debugfs_dbg_modules_write,
                        "%llu\n");
 
-static int iwm_generic_open(struct inode *inode, struct file *filp)
-{
-       filp->private_data = inode->i_private;
-       return 0;
-}
-
 
 static ssize_t iwm_debugfs_txq_read(struct file *filp, char __user *buffer,
                                   size_t count, loff_t *ppos)
@@ -401,28 +395,28 @@ out:
 
 static const struct file_operations iwm_debugfs_txq_fops = {
        .owner =        THIS_MODULE,
-       .open =         iwm_generic_open,
+       .open =         simple_open,
        .read =         iwm_debugfs_txq_read,
        .llseek =       default_llseek,
 };
 
 static const struct file_operations iwm_debugfs_tx_credit_fops = {
        .owner =        THIS_MODULE,
-       .open =         iwm_generic_open,
+       .open =         simple_open,
        .read =         iwm_debugfs_tx_credit_read,
        .llseek =       default_llseek,
 };
 
 static const struct file_operations iwm_debugfs_rx_ticket_fops = {
        .owner =        THIS_MODULE,
-       .open =         iwm_generic_open,
+       .open =         simple_open,
        .read =         iwm_debugfs_rx_ticket_read,
        .llseek =       default_llseek,
 };
 
 static const struct file_operations iwm_debugfs_fw_err_fops = {
        .owner =        THIS_MODULE,
-       .open =         iwm_generic_open,
+       .open =         simple_open,
        .read =         iwm_debugfs_fw_err_read,
        .llseek =       default_llseek,
 };
index 764b40dd24adad66722756dd3833b9c191969f1a..0042f204b07fabc91e182c3a6c8c2cad2b2b9ffc 100644 (file)
@@ -264,13 +264,6 @@ static int if_sdio_send_chunk(struct iwm_priv *iwm, u8 *buf, int count)
        return ret;
 }
 
-/* debugfs hooks */
-static int iwm_debugfs_sdio_open(struct inode *inode, struct file *filp)
-{
-       filp->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t iwm_debugfs_sdio_read(struct file *filp, char __user *buffer,
                                     size_t count, loff_t *ppos)
 {
@@ -363,7 +356,7 @@ err:
 
 static const struct file_operations iwm_debugfs_sdio_fops = {
        .owner =        THIS_MODULE,
-       .open =         iwm_debugfs_sdio_open,
+       .open =         simple_open,
        .read =         iwm_debugfs_sdio_read,
        .llseek =       default_llseek,
 };
index c192671610fcf5bec8c117c10972e5ab569e9d03..a06cc283e23d1c3df6b645f30ce992875e0a0382 100644 (file)
@@ -21,12 +21,6 @@ static char *szStates[] = {
 static void lbs_debug_init(struct lbs_private *priv);
 #endif
 
-static int open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t write_file_dummy(struct file *file, const char __user *buf,
                                 size_t count, loff_t *ppos)
 {
@@ -696,7 +690,7 @@ out_unlock:
 
 #define FOPS(fread, fwrite) { \
        .owner = THIS_MODULE, \
-       .open = open_file_generic, \
+       .open = simple_open, \
        .read = (fread), \
        .write = (fwrite), \
        .llseek = generic_file_llseek, \
@@ -962,7 +956,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
 
 static const struct file_operations lbs_debug_fops = {
        .owner = THIS_MODULE,
-       .open = open_file_generic,
+       .open = simple_open,
        .write = lbs_debugfs_write,
        .read = lbs_debugfs_read,
        .llseek = default_llseek,
index d26a78b6b3c43d0642a181dde7815c6972b636ab..1a845074c52ac967273f17beb57bbedd924795ba 100644 (file)
@@ -139,18 +139,6 @@ static struct mwifiex_debug_data items[] = {
 
 static int num_of_items = ARRAY_SIZE(items);
 
-/*
- * Generic proc file open handler.
- *
- * This function is called every time a file is accessed for read or write.
- */
-static int
-mwifiex_open_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 /*
  * Proc info file read handler.
  *
@@ -676,19 +664,19 @@ done:
 static const struct file_operations mwifiex_dfs_##name##_fops = {       \
        .read = mwifiex_##name##_read,                                  \
        .write = mwifiex_##name##_write,                                \
-       .open = mwifiex_open_generic,                                   \
+       .open = simple_open,                                            \
 };
 
 #define MWIFIEX_DFS_FILE_READ_OPS(name)                                 \
 static const struct file_operations mwifiex_dfs_##name##_fops = {       \
        .read = mwifiex_##name##_read,                                  \
-       .open = mwifiex_open_generic,                                   \
+       .open = simple_open,                                            \
 };
 
 #define MWIFIEX_DFS_FILE_WRITE_OPS(name)                                \
 static const struct file_operations mwifiex_dfs_##name##_fops = {       \
        .write = mwifiex_##name##_write,                                \
-       .open = mwifiex_open_generic,                                   \
+       .open = simple_open,                                            \
 };
 
 
index 6c274007d200f53fa950a4a737387d9714fb32e6..448da1f8c22f1796a0dcb8abe4c7646d3f0551c1 100644 (file)
@@ -47,7 +47,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf,  \
                                                                        \
 static const struct file_operations name## _ops = {                    \
        .read = name## _read,                                           \
-       .open = wl1251_open_file_generic,                               \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -84,7 +84,7 @@ static ssize_t sub## _ ##name## _read(struct file *file,              \
                                                                        \
 static const struct file_operations sub## _ ##name## _ops = {          \
        .read = sub## _ ##name## _read,                                 \
-       .open = wl1251_open_file_generic,                               \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -117,12 +117,6 @@ out:
        mutex_unlock(&wl->mutex);
 }
 
-static int wl1251_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, 20, "%u");
 
 DEBUGFS_FWSTATS_FILE(rx, out_of_mem, 20, "%u");
@@ -235,7 +229,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations tx_queue_len_ops = {
        .read = tx_queue_len_read,
-       .open = wl1251_open_file_generic,
+       .open = simple_open,
        .llseek = generic_file_llseek,
 };
 
@@ -257,7 +251,7 @@ static ssize_t tx_queue_status_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations tx_queue_status_ops = {
        .read = tx_queue_status_read,
-       .open = wl1251_open_file_generic,
+       .open = simple_open,
        .llseek = generic_file_llseek,
 };
 
index e1cf727659650a90f9ae43f8636003409404eb00..564d49575c94d49cc98f5d718db2aa22c986adb0 100644 (file)
@@ -63,7 +63,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf,  \
                                                                        \
 static const struct file_operations name## _ops = {                    \
        .read = name## _read,                                           \
-       .open = wl1271_open_file_generic,                               \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -96,7 +96,7 @@ static ssize_t sub## _ ##name## _read(struct file *file,              \
                                                                        \
 static const struct file_operations sub## _ ##name## _ops = {          \
        .read = sub## _ ##name## _read,                                 \
-       .open = wl1271_open_file_generic,                               \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -126,12 +126,6 @@ out:
        mutex_unlock(&wl->mutex);
 }
 
-static int wl1271_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 DEBUGFS_FWSTATS_FILE(tx, internal_desc_overflow, "%u");
 
 DEBUGFS_FWSTATS_FILE(rx, out_of_mem, "%u");
@@ -243,7 +237,7 @@ static ssize_t tx_queue_len_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations tx_queue_len_ops = {
        .read = tx_queue_len_read,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -289,7 +283,7 @@ static ssize_t gpio_power_write(struct file *file,
 static const struct file_operations gpio_power_ops = {
        .read = gpio_power_read,
        .write = gpio_power_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -308,7 +302,7 @@ static ssize_t start_recovery_write(struct file *file,
 
 static const struct file_operations start_recovery_ops = {
        .write = start_recovery_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -372,7 +366,7 @@ out:
 static const struct file_operations dynamic_ps_timeout_ops = {
        .read = dynamic_ps_timeout_read,
        .write = dynamic_ps_timeout_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -441,7 +435,7 @@ out:
 static const struct file_operations forced_ps_ops = {
        .read = forced_ps_read,
        .write = forced_ps_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -483,7 +477,7 @@ static ssize_t split_scan_timeout_write(struct file *file,
 static const struct file_operations split_scan_timeout_ops = {
        .read = split_scan_timeout_read,
        .write = split_scan_timeout_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -566,7 +560,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
 
 static const struct file_operations driver_state_ops = {
        .read = driver_state_read,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -675,7 +669,7 @@ static ssize_t vifs_state_read(struct file *file, char __user *user_buf,
 
 static const struct file_operations vifs_state_ops = {
        .read = vifs_state_read,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -733,7 +727,7 @@ static ssize_t dtim_interval_write(struct file *file,
 static const struct file_operations dtim_interval_ops = {
        .read = dtim_interval_read,
        .write = dtim_interval_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -791,7 +785,7 @@ static ssize_t suspend_dtim_interval_write(struct file *file,
 static const struct file_operations suspend_dtim_interval_ops = {
        .read = suspend_dtim_interval_read,
        .write = suspend_dtim_interval_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -849,7 +843,7 @@ static ssize_t beacon_interval_write(struct file *file,
 static const struct file_operations beacon_interval_ops = {
        .read = beacon_interval_read,
        .write = beacon_interval_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -904,7 +898,7 @@ static ssize_t rx_streaming_interval_read(struct file *file,
 static const struct file_operations rx_streaming_interval_ops = {
        .read = rx_streaming_interval_read,
        .write = rx_streaming_interval_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -959,7 +953,7 @@ static ssize_t rx_streaming_always_read(struct file *file,
 static const struct file_operations rx_streaming_always_ops = {
        .read = rx_streaming_always_read,
        .write = rx_streaming_always_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
@@ -1003,7 +997,7 @@ out:
 
 static const struct file_operations beacon_filtering_ops = {
        .write = beacon_filtering_write,
-       .open = wl1271_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
index ee8fd037bb53c887de88cf67097c2c9dc710d72f..849357c1045c57b5c7a229dee3ccae27a9c2a922 100644 (file)
@@ -117,25 +117,17 @@ static ssize_t ulong_write_file(struct file *file, char const __user *buf, size_
 }
 
 
-static int default_open(struct inode *inode, struct file *filp)
-{
-       if (inode->i_private)
-               filp->private_data = inode->i_private;
-       return 0;
-}
-
-
 static const struct file_operations ulong_fops = {
        .read           = ulong_read_file,
        .write          = ulong_write_file,
-       .open           = default_open,
+       .open           = simple_open,
        .llseek         = default_llseek,
 };
 
 
 static const struct file_operations ulong_ro_fops = {
        .read           = ulong_read_file,
-       .open           = default_open,
+       .open           = simple_open,
        .llseek         = default_llseek,
 };
 
@@ -187,7 +179,7 @@ static ssize_t atomic_read_file(struct file *file, char __user *buf, size_t coun
 
 static const struct file_operations atomic_ro_fops = {
        .read           = atomic_read_file,
-       .open           = default_open,
+       .open           = simple_open,
        .llseek         = default_llseek,
 };
 
index 70277a530133451dd298281c214f91bcc9d66006..85d31a69e1175f597cf6b24f50158803dabdfaf9 100644 (file)
@@ -50,16 +50,9 @@ static ssize_t rproc_trace_read(struct file *filp, char __user *userbuf,
        return simple_read_from_buffer(userbuf, count, ppos, trace->va, len);
 }
 
-static int rproc_open_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-
-       return 0;
-}
-
 static const struct file_operations trace_rproc_ops = {
        .read = rproc_trace_read,
-       .open = rproc_open_generic,
+       .open = simple_open,
        .llseek = generic_file_llseek,
 };
 
@@ -94,7 +87,7 @@ static ssize_t rproc_state_read(struct file *filp, char __user *userbuf,
 
 static const struct file_operations rproc_state_ops = {
        .read = rproc_state_read,
-       .open = rproc_open_generic,
+       .open = simple_open,
        .llseek = generic_file_llseek,
 };
 
@@ -114,7 +107,7 @@ static ssize_t rproc_name_read(struct file *filp, char __user *userbuf,
 
 static const struct file_operations rproc_name_ops = {
        .read = rproc_name_read,
-       .open = rproc_open_generic,
+       .open = simple_open,
        .llseek = generic_file_llseek,
 };
 
index afee0e8ae714426ad787fbe1be7d372c888e87f0..feddefc42109b5fe891b82b0c1ed520a6b9e9613 100644 (file)
@@ -72,9 +72,9 @@ static int pm860x_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)
        struct pm860x_rtc_info *info = dev_get_drvdata(dev);
 
        if (enabled)
-               pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM, ALARM);
+               pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM_EN, ALARM_EN);
        else
-               pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM, 0);
+               pm860x_set_bits(info->i2c, PM8607_RTC1, ALARM_EN, 0);
        return 0;
 }
 
index 5bdf2eecb1782dd4c33f863607d045ed27535fe9..af04b0d6688dbb19400fbf498781b37bb92ea420 100644 (file)
@@ -997,13 +997,6 @@ lpfc_debugfs_dumpDataDif_write(struct file *file, const char __user *buf,
        return nbytes;
 }
 
-static int
-lpfc_debugfs_dif_err_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t
 lpfc_debugfs_dif_err_read(struct file *file, char __user *buf,
        size_t nbytes, loff_t *ppos)
@@ -3541,7 +3534,7 @@ static const struct file_operations lpfc_debugfs_op_dumpDif = {
 #undef lpfc_debugfs_op_dif_err
 static const struct file_operations lpfc_debugfs_op_dif_err = {
        .owner =        THIS_MODULE,
-       .open =         lpfc_debugfs_dif_err_open,
+       .open =         simple_open,
        .llseek =       lpfc_debugfs_lseek,
        .read =         lpfc_debugfs_dif_err_read,
        .write =        lpfc_debugfs_dif_err_write,
index 082458d73ce9798d38bb494840d3bec058650643..d1a495f64e2d62317602d3d2a6d1b56a0eff3f90 100644 (file)
@@ -63,12 +63,6 @@ struct chip_data {
 };
 
 #ifdef CONFIG_DEBUG_FS
-static int spi_show_regs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 #define SPI_REGS_BUFSIZE       1024
 static ssize_t  spi_show_regs(struct file *file, char __user *user_buf,
                                size_t count, loff_t *ppos)
@@ -128,7 +122,7 @@ static ssize_t  spi_show_regs(struct file *file, char __user *user_buf,
 
 static const struct file_operations mrst_spi_regs_ops = {
        .owner          = THIS_MODULE,
-       .open           = spi_show_regs_open,
+       .open           = simple_open,
        .read           = spi_show_regs,
        .llseek         = default_llseek,
 };
index a9234ba8f8d5b4df867092ad4229b9b933859b6d..c4b50af46c444b237b0054f454b27b5c9ec2749f 100644 (file)
@@ -127,11 +127,6 @@ static inline void serial_out(struct uart_hsu_port *up, int offset, int value)
 
 #define HSU_REGS_BUFSIZE       1024
 
-static int hsu_show_regs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
 
 static ssize_t port_show_regs(struct file *file, char __user *user_buf,
                                size_t count, loff_t *ppos)
@@ -231,14 +226,14 @@ static ssize_t dma_show_regs(struct file *file, char __user *user_buf,
 
 static const struct file_operations port_regs_ops = {
        .owner          = THIS_MODULE,
-       .open           = hsu_show_regs_open,
+       .open           = simple_open,
        .read           = port_show_regs,
        .llseek         = default_llseek,
 };
 
 static const struct file_operations dma_regs_ops = {
        .owner          = THIS_MODULE,
-       .open           = hsu_show_regs_open,
+       .open           = simple_open,
        .read           = dma_show_regs,
        .llseek         = default_llseek,
 };
index e825460478befc40ad9e9a4d36243fa741a48cf0..08b9962b8fdab8813bbb453f120870eb1fbb96d3 100644 (file)
@@ -304,11 +304,7 @@ static const int trigger_level_1[4] = { 1, 1, 1, 1 };
 #ifdef CONFIG_DEBUG_FS
 
 #define PCH_REGS_BUFSIZE       1024
-static int pch_show_regs_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
+
 
 static ssize_t port_show_regs(struct file *file, char __user *user_buf,
                                size_t count, loff_t *ppos)
@@ -362,7 +358,7 @@ static ssize_t port_show_regs(struct file *file, char __user *user_buf,
 
 static const struct file_operations port_regs_ops = {
        .owner          = THIS_MODULE,
-       .open           = pch_show_regs_open,
+       .open           = simple_open,
        .read           = port_show_regs,
        .llseek         = default_llseek,
 };
index 136e86faa1e17e0e807a3c41b93fd464fd7c8729..05728894a88c23330e7b57eb8994f50477fc1b73 100644 (file)
@@ -327,7 +327,7 @@ static void send_sig_all(int sig)
                if (is_global_init(p))
                        continue;
 
-               force_sig(sig, p);
+               do_send_sig_info(sig, SEND_SIG_FORCED, p, true);
        }
        read_unlock(&tasklist_lock);
 }
index cefa0c8b5b6ab983468b36ceed1cac3f66cbcb0e..d2b9af59cba9ab13da2cdbaac1160a30219bf277 100644 (file)
@@ -428,18 +428,10 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig)
        return retval;
 }
 
-static int default_open (struct inode *inode, struct file *file)
-{
-       if (inode->i_private)
-               file->private_data = inode->i_private;
-
-       return 0;
-}
-
 static const struct file_operations default_file_operations = {
        .read =         default_read_file,
        .write =        default_write_file,
-       .open =         default_open,
+       .open =         simple_open,
        .llseek =       default_file_lseek,
 };
 
index fd9109d7eb0ed9491d5212caba8d3f6af20c2452..680e1a31fb87c2ae9538e8667c8dab0861a6410f 100644 (file)
@@ -352,7 +352,6 @@ static int debug_async_open(struct inode *, struct file *);
 static int debug_periodic_open(struct inode *, struct file *);
 static int debug_registers_open(struct inode *, struct file *);
 static int debug_async_open(struct inode *, struct file *);
-static int debug_lpm_open(struct inode *, struct file *);
 static ssize_t debug_lpm_read(struct file *file, char __user *user_buf,
                                   size_t count, loff_t *ppos);
 static ssize_t debug_lpm_write(struct file *file, const char __user *buffer,
@@ -385,7 +384,7 @@ static const struct file_operations debug_registers_fops = {
 };
 static const struct file_operations debug_lpm_fops = {
        .owner          = THIS_MODULE,
-       .open           = debug_lpm_open,
+       .open           = simple_open,
        .read           = debug_lpm_read,
        .write          = debug_lpm_write,
        .release        = debug_lpm_close,
@@ -970,12 +969,6 @@ static int debug_registers_open(struct inode *inode, struct file *file)
        return file->private_data ? 0 : -ENOMEM;
 }
 
-static int debug_lpm_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static int debug_lpm_close(struct inode *inode, struct file *file)
 {
        return 0;
index 2eecec0c13c9bf1bba5013865fdfdd799c175af0..6ec45beb7af5e5bf55756e6d622447dc989dfc48 100644 (file)
@@ -159,13 +159,6 @@ static int cmd_ie_rm(struct uwb_rc *rc, struct uwb_dbg_cmd_ie *ie_to_rm)
        return uwb_rc_ie_rm(rc, ie_to_rm->data[0]);
 }
 
-static int command_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-
-       return 0;
-}
-
 static ssize_t command_write(struct file *file, const char __user *buf,
                         size_t len, loff_t *off)
 {
@@ -206,7 +199,7 @@ static ssize_t command_write(struct file *file, const char __user *buf,
 }
 
 static const struct file_operations command_fops = {
-       .open   = command_open,
+       .open   = simple_open,
        .write  = command_write,
        .read   = NULL,
        .llseek = no_llseek,
index 7ed9991fa74785cb8d232954c10d0925caed59ab..af16884491edf45cf3105f79e340a6b912757541 100644 (file)
@@ -245,6 +245,12 @@ config BACKLIGHT_DA903X
          If you have a LCD backlight connected to the WLED output of DA9030
          or DA9034 WLED output, say Y here to enable this driver.
 
+config BACKLIGHT_DA9052
+       tristate "Dialog DA9052/DA9053 WLED"
+       depends on PMIC_DA9052
+       help
+         Enable the Backlight Driver for DA9052-BC and DA9053-AA/Bx PMICs.
+
 config BACKLIGHT_MAX8925
        tristate "Backlight driver for MAX8925"
        depends on MFD_MAX8925
index 8071eb656147796dfc410ee92a5bc84f7429aa4a..36855ae887d6ae9f56a85a0b02b24a3afa271c83 100644 (file)
@@ -29,6 +29,7 @@ obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
 obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
 obj-$(CONFIG_BACKLIGHT_PWM)    += pwm_bl.o
 obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o
+obj-$(CONFIG_BACKLIGHT_DA9052) += da9052_bl.o
 obj-$(CONFIG_BACKLIGHT_MAX8925)        += max8925_bl.o
 obj-$(CONFIG_BACKLIGHT_APPLE)  += apple_bl.o
 obj-$(CONFIG_BACKLIGHT_TOSA)   += tosa_bl.o
diff --git a/drivers/video/backlight/da9052_bl.c b/drivers/video/backlight/da9052_bl.c
new file mode 100644 (file)
index 0000000..b628d68
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * Backlight Driver for Dialog DA9052 PMICs
+ *
+ * Copyright(c) 2012 Dialog Semiconductor Ltd.
+ *
+ * Author: David Dajun Chen <dchen@diasemi.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/fb.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include <linux/mfd/da9052/da9052.h>
+#include <linux/mfd/da9052/reg.h>
+
+#define DA9052_MAX_BRIGHTNESS          0xFF
+
+enum {
+       DA9052_WLEDS_OFF,
+       DA9052_WLEDS_ON,
+};
+
+enum {
+       DA9052_TYPE_WLED1,
+       DA9052_TYPE_WLED2,
+       DA9052_TYPE_WLED3,
+};
+
+static unsigned char wled_bank[] = {
+       DA9052_LED1_CONF_REG,
+       DA9052_LED2_CONF_REG,
+       DA9052_LED3_CONF_REG,
+};
+
+struct da9052_bl {
+       struct da9052 *da9052;
+       uint brightness;
+       uint state;
+       uint led_reg;
+};
+
+static int da9052_adjust_wled_brightness(struct da9052_bl *wleds)
+{
+       unsigned char boost_en;
+       unsigned char i_sink;
+       int ret;
+
+       boost_en = 0x3F;
+       i_sink = 0xFF;
+       if (wleds->state == DA9052_WLEDS_OFF) {
+               boost_en = 0x00;
+               i_sink = 0x00;
+       }
+
+       ret = da9052_reg_write(wleds->da9052, DA9052_BOOST_REG, boost_en);
+       if (ret < 0)
+               return ret;
+
+       ret = da9052_reg_write(wleds->da9052, DA9052_LED_CONT_REG, i_sink);
+       if (ret < 0)
+               return ret;
+
+       ret = da9052_reg_write(wleds->da9052, wled_bank[wleds->led_reg], 0x0);
+       if (ret < 0)
+               return ret;
+
+       msleep(10);
+
+       if (wleds->brightness) {
+               ret = da9052_reg_write(wleds->da9052, wled_bank[wleds->led_reg],
+                                      wleds->brightness);
+               if (ret < 0)
+                       return ret;
+       }
+
+       return 0;
+}
+
+static int da9052_backlight_update_status(struct backlight_device *bl)
+{
+       int brightness = bl->props.brightness;
+       struct da9052_bl *wleds = bl_get_data(bl);
+
+       wleds->brightness = brightness;
+       wleds->state = DA9052_WLEDS_ON;
+
+       return da9052_adjust_wled_brightness(wleds);
+}
+
+static int da9052_backlight_get_brightness(struct backlight_device *bl)
+{
+       struct da9052_bl *wleds = bl_get_data(bl);
+
+       return wleds->brightness;
+}
+
+static const struct backlight_ops da9052_backlight_ops = {
+       .update_status = da9052_backlight_update_status,
+       .get_brightness = da9052_backlight_get_brightness,
+};
+
+static int da9052_backlight_probe(struct platform_device *pdev)
+{
+       struct backlight_device *bl;
+       struct backlight_properties props;
+       struct da9052_bl *wleds;
+
+       wleds = devm_kzalloc(&pdev->dev, sizeof(struct da9052_bl), GFP_KERNEL);
+       if (!wleds)
+               return -ENOMEM;
+
+       wleds->da9052 = dev_get_drvdata(pdev->dev.parent);
+       wleds->brightness = 0;
+       wleds->led_reg = platform_get_device_id(pdev)->driver_data;
+       wleds->state = DA9052_WLEDS_OFF;
+
+       props.type = BACKLIGHT_RAW;
+       props.max_brightness = DA9052_MAX_BRIGHTNESS;
+
+       bl = backlight_device_register(pdev->name, wleds->da9052->dev, wleds,
+                                      &da9052_backlight_ops, &props);
+       if (IS_ERR(bl)) {
+               dev_err(&pdev->dev, "Failed to register backlight\n");
+               devm_kfree(&pdev->dev, wleds);
+               return PTR_ERR(bl);
+       }
+
+       bl->props.max_brightness = DA9052_MAX_BRIGHTNESS;
+       bl->props.brightness = 0;
+       platform_set_drvdata(pdev, bl);
+
+       return da9052_adjust_wled_brightness(wleds);
+}
+
+static int da9052_backlight_remove(struct platform_device *pdev)
+{
+       struct backlight_device *bl = platform_get_drvdata(pdev);
+       struct da9052_bl *wleds = bl_get_data(bl);
+
+       wleds->brightness = 0;
+       wleds->state = DA9052_WLEDS_OFF;
+       da9052_adjust_wled_brightness(wleds);
+       backlight_device_unregister(bl);
+       devm_kfree(&pdev->dev, wleds);
+
+       return 0;
+}
+
+static struct platform_device_id da9052_wled_ids[] = {
+       {
+               .name           = "da9052-wled1",
+               .driver_data    = DA9052_TYPE_WLED1,
+       },
+       {
+               .name           = "da9052-wled2",
+               .driver_data    = DA9052_TYPE_WLED2,
+       },
+       {
+               .name           = "da9052-wled3",
+               .driver_data    = DA9052_TYPE_WLED3,
+       },
+};
+
+static struct platform_driver da9052_wled_driver = {
+       .probe          = da9052_backlight_probe,
+       .remove         = da9052_backlight_remove,
+       .id_table       = da9052_wled_ids,
+       .driver = {
+               .name   = "da9052-wled",
+               .owner  = THIS_MODULE,
+       },
+};
+
+module_platform_driver(da9052_wled_driver);
+
+MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>");
+MODULE_DESCRIPTION("Backlight driver for DA9052 PMIC");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:da9052-backlight");
index 21e93605161c1909abb852b89af8c5c08a0ef336..5dfafdd1dbd3cbdd553ef3f88fce4d0ff2fe54a5 100644 (file)
@@ -33,18 +33,10 @@ static ssize_t default_write_file(struct file *file, const char __user *buf,
        return count;
 }
 
-static int default_open(struct inode *inode, struct file *file)
-{
-       if (inode->i_private)
-               file->private_data = inode->i_private;
-
-       return 0;
-}
-
 const struct file_operations debugfs_file_operations = {
        .read =         default_read_file,
        .write =        default_write_file,
-       .open =         default_open,
+       .open =         simple_open,
        .llseek =       noop_llseek,
 };
 
@@ -447,7 +439,7 @@ static ssize_t write_file_bool(struct file *file, const char __user *user_buf,
 static const struct file_operations fops_bool = {
        .read =         read_file_bool,
        .write =        write_file_bool,
-       .open =         default_open,
+       .open =         simple_open,
        .llseek =       default_llseek,
 };
 
@@ -492,7 +484,7 @@ static ssize_t read_file_blob(struct file *file, char __user *user_buf,
 
 static const struct file_operations fops_blob = {
        .read =         read_file_blob,
-       .open =         default_open,
+       .open =         simple_open,
        .llseek =       default_llseek,
 };
 
index 3dca2b39e83fa9c8b5025f0e3aefa94252ed0a41..1c9b08095f987e0899d13801e3faadbcbf74876c 100644 (file)
@@ -609,13 +609,6 @@ static const struct file_operations format3_fops = {
 /*
  * dump lkb's on the ls_waiters list
  */
-
-static int waiters_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t waiters_read(struct file *file, char __user *userbuf,
                            size_t count, loff_t *ppos)
 {
@@ -644,7 +637,7 @@ static ssize_t waiters_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations waiters_fops = {
        .owner   = THIS_MODULE,
-       .open    = waiters_open,
+       .open    = simple_open,
        .read    = waiters_read,
        .llseek  = default_llseek,
 };
index ea251749d9d5982e6fc35ecf6d21ab61547962e8..28cf06e4ec8466478ce34db5db271f179dc0d7b5 100644 (file)
@@ -1031,7 +1031,6 @@ static int __init init_hugetlbfs_fs(void)
        }
 
        error = PTR_ERR(vfsmount);
-       unregister_filesystem(&hugetlbfs_fs_type);
 
  out:
        kmem_cache_destroy(hugetlbfs_inode_cachep);
index 4a0d1f06da5746798a86157c50a227f63d9deed8..358094f0433d41c0fbe21360a24e9a475d95e3da 100644 (file)
@@ -264,6 +264,13 @@ Enomem:
        return ERR_PTR(-ENOMEM);
 }
 
+int simple_open(struct inode *inode, struct file *file)
+{
+       if (inode->i_private)
+               file->private_data = inode->i_private;
+       return 0;
+}
+
 int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
 {
        struct inode *inode = old_dentry->d_inode;
@@ -984,6 +991,7 @@ EXPORT_SYMBOL(simple_dir_operations);
 EXPORT_SYMBOL(simple_empty);
 EXPORT_SYMBOL(simple_fill_super);
 EXPORT_SYMBOL(simple_getattr);
+EXPORT_SYMBOL(simple_open);
 EXPORT_SYMBOL(simple_link);
 EXPORT_SYMBOL(simple_lookup);
 EXPORT_SYMBOL(simple_pin_fs);
index 46a15d8a29ca74d9ca0a68a57e416108e6b599f3..eed44bfc85db7c6ea420233dd09c2e5b9b5f0350 100644 (file)
@@ -115,12 +115,13 @@ static struct dentry *proc_mount(struct file_system_type *fs_type,
        if (IS_ERR(sb))
                return ERR_CAST(sb);
 
+       if (!proc_parse_options(options, ns)) {
+               deactivate_locked_super(sb);
+               return ERR_PTR(-EINVAL);
+       }
+
        if (!sb->s_root) {
                sb->s_flags = flags;
-               if (!proc_parse_options(options, ns)) {
-                       deactivate_locked_super(sb);
-                       return ERR_PTR(-EINVAL);
-               }
                err = proc_fill_super(sb);
                if (err) {
                        deactivate_locked_super(sb);
index 50952c9bd06c0c460097eeedface267575f11aa5..19507889bb7ff123b3922fa439fc0c8ef1ded913 100644 (file)
@@ -52,12 +52,6 @@ struct pstore_private {
        char    data[];
 };
 
-static int pstore_file_open(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t pstore_file_read(struct file *file, char __user *userbuf,
                                                size_t count, loff_t *ppos)
 {
@@ -67,7 +61,7 @@ static ssize_t pstore_file_read(struct file *file, char __user *userbuf,
 }
 
 static const struct file_operations pstore_file_operations = {
-       .open   = pstore_file_open,
+       .open   = simple_open,
        .read   = pstore_file_read,
        .llseek = default_llseek,
 };
index d6dfd247bb2f4425fdfbd9c57b892a07c3922847..3c8c1cc333c7c79dfa105049a62d8b6e1c28661c 100644 (file)
@@ -19,8 +19,9 @@
 #include <linux/export.h>
 #include <linux/fsnotify.h>
 #include <linux/audit.h>
-#include <asm/uaccess.h>
+#include <linux/vmalloc.h>
 
+#include <asm/uaccess.h>
 
 /*
  * Check permissions for extended attribute access.  This is a bit complicated
@@ -320,6 +321,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
 {
        int error;
        void *kvalue = NULL;
+       void *vvalue = NULL;    /* If non-NULL, we used vmalloc() */
        char kname[XATTR_NAME_MAX + 1];
 
        if (flags & ~(XATTR_CREATE|XATTR_REPLACE))
@@ -334,13 +336,25 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
        if (size) {
                if (size > XATTR_SIZE_MAX)
                        return -E2BIG;
-               kvalue = memdup_user(value, size);
-               if (IS_ERR(kvalue))
-                       return PTR_ERR(kvalue);
+               kvalue = kmalloc(size, GFP_KERNEL | __GFP_NOWARN);
+               if (!kvalue) {
+                       vvalue = vmalloc(size);
+                       if (!vvalue)
+                               return -ENOMEM;
+                       kvalue = vvalue;
+               }
+               if (copy_from_user(kvalue, value, size)) {
+                       error = -EFAULT;
+                       goto out;
+               }
        }
 
        error = vfs_setxattr(d, kname, kvalue, size, flags);
-       kfree(kvalue);
+out:
+       if (vvalue)
+               vfree(vvalue);
+       else
+               kfree(kvalue);
        return error;
 }
 
@@ -492,13 +506,18 @@ listxattr(struct dentry *d, char __user *list, size_t size)
 {
        ssize_t error;
        char *klist = NULL;
+       char *vlist = NULL;     /* If non-NULL, we used vmalloc() */
 
        if (size) {
                if (size > XATTR_LIST_MAX)
                        size = XATTR_LIST_MAX;
-               klist = kmalloc(size, GFP_KERNEL);
-               if (!klist)
-                       return -ENOMEM;
+               klist = kmalloc(size, __GFP_NOWARN | GFP_KERNEL);
+               if (!klist) {
+                       vlist = vmalloc(size);
+                       if (!vlist)
+                               return -ENOMEM;
+                       klist = vlist;
+               }
        }
 
        error = vfs_listxattr(d, klist, size);
@@ -510,7 +529,10 @@ listxattr(struct dentry *d, char __user *list, size_t size)
                   than XATTR_LIST_MAX bytes. Not possible. */
                error = -E2BIG;
        }
-       kfree(klist);
+       if (vlist)
+               vfree(vlist);
+       else
+               kfree(klist);
        return error;
 }
 
index 528611843ba0f5543880a953dc38e71a32cbb3f6..8de675523e464db26c649928610fb4a69bac7a40 100644 (file)
@@ -2511,6 +2511,7 @@ extern int dcache_readdir(struct file *, void *, filldir_t);
 extern int simple_setattr(struct dentry *, struct iattr *);
 extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 extern int simple_statfs(struct dentry *, struct kstatfs *);
+extern int simple_open(struct inode *inode, struct file *file);
 extern int simple_link(struct dentry *, struct inode *, struct dentry *);
 extern int simple_unlink(struct inode *, struct dentry *);
 extern int simple_rmdir(struct inode *, struct dentry *);
index 8dc0ea7caf02baa404e8896d13351577a177547a..b1fd5c7925feab91948ee46f0b5140b4c0ae5399 100644 (file)
@@ -305,6 +305,13 @@ static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
        return vm_swappiness;
 }
 #endif
+#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
+extern void mem_cgroup_uncharge_swap(swp_entry_t ent);
+#else
+static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
+{
+}
+#endif
 #ifdef CONFIG_SWAP
 /* linux/mm/page_io.c */
 extern int swap_readpage(struct page *);
@@ -375,13 +382,6 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
 {
 }
 #endif
-#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
-extern void mem_cgroup_uncharge_swap(swp_entry_t ent);
-#else
-static inline void mem_cgroup_uncharge_swap(swp_entry_t ent)
-{
-}
-#endif
 
 #else /* CONFIG_SWAP */
 
index cdea7b56b0c94e54075d7982ed8967360f0e1ea7..c0bd0308741ca1a343a9cbc0b551b4a12438ddd7 100644 (file)
@@ -311,13 +311,6 @@ int blk_trace_remove(struct request_queue *q)
 }
 EXPORT_SYMBOL_GPL(blk_trace_remove);
 
-static int blk_dropped_open(struct inode *inode, struct file *filp)
-{
-       filp->private_data = inode->i_private;
-
-       return 0;
-}
-
 static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
                                size_t count, loff_t *ppos)
 {
@@ -331,18 +324,11 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
 
 static const struct file_operations blk_dropped_fops = {
        .owner =        THIS_MODULE,
-       .open =         blk_dropped_open,
+       .open =         simple_open,
        .read =         blk_dropped_read,
        .llseek =       default_llseek,
 };
 
-static int blk_msg_open(struct inode *inode, struct file *filp)
-{
-       filp->private_data = inode->i_private;
-
-       return 0;
-}
-
 static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
                                size_t count, loff_t *ppos)
 {
@@ -371,7 +357,7 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
 
 static const struct file_operations blk_msg_fops = {
        .owner =        THIS_MODULE,
-       .open =         blk_msg_open,
+       .open =         simple_open,
        .write =        blk_msg_write,
        .llseek =       noop_llseek,
 };
index cc5b7a6e7e0b084d2e8cb7e2f06d0e3f392eabc1..778e5916d7c3e140ccc3cb98012b39204e3003c7 100644 (file)
 #include "rate.h"
 #include "debugfs.h"
 
-int mac80211_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 #define DEBUGFS_FORMAT_BUFFER_SIZE 100
 
 int mac80211_format_buffer(char __user *userbuf, size_t count,
@@ -50,7 +44,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf,  \
 #define DEBUGFS_READONLY_FILE_OPS(name)                        \
 static const struct file_operations name## _ops = {                    \
        .read = name## _read,                                           \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -93,7 +87,7 @@ static ssize_t reset_write(struct file *file, const char __user *user_buf,
 
 static const struct file_operations reset_ops = {
        .write = reset_write,
-       .open = mac80211_open_file_generic,
+       .open = simple_open,
        .llseek = noop_llseek,
 };
 
@@ -254,7 +248,7 @@ static ssize_t stats_ ##name## _read(struct file *file,                     \
                                                                        \
 static const struct file_operations stats_ ##name## _ops = {           \
        .read = stats_ ##name## _read,                                  \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
index 7c87529630f55eabd2ba45721d73f138dad7401a..9be4e6d71d00d736db7eeee2f24a645b1c41b2bb 100644 (file)
@@ -3,7 +3,6 @@
 
 #ifdef CONFIG_MAC80211_DEBUGFS
 extern void debugfs_hw_add(struct ieee80211_local *local);
-extern int mac80211_open_file_generic(struct inode *inode, struct file *file);
 extern int mac80211_format_buffer(char __user *userbuf, size_t count,
                                  loff_t *ppos, char *fmt, ...);
 #else
index 59edcd95a58dbcec31833568f9d5f8bd8893da09..7932767bb482415f9b50ec0043c0c56246476f04 100644 (file)
@@ -30,7 +30,7 @@ static ssize_t key_##name##_read(struct file *file,                   \
 #define KEY_OPS(name)                                                  \
 static const struct file_operations key_ ##name## _ops = {             \
        .read = key_##name##_read,                                      \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 }
 
@@ -45,7 +45,7 @@ static const struct file_operations key_ ##name## _ops = {            \
 #define KEY_CONF_OPS(name)                                             \
 static const struct file_operations key_ ##name## _ops = {             \
        .read = key_conf_##name##_read,                                 \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 }
 
index a32eeda04aa3f1bb980066f0183615c2acffd8df..30f99c344847c0802a9dd21c820a06bd99371a7e 100644 (file)
@@ -135,7 +135,7 @@ static ssize_t ieee80211_if_read_##name(struct file *file,          \
 static const struct file_operations name##_ops = {                     \
        .read = ieee80211_if_read_##name,                               \
        .write = (_write),                                              \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 }
 
index 6d45804d09bc0a26ef9025c8751355ffebd13b8f..832b2da5e4cd8955b11920e9fe4537e7e0981687 100644 (file)
@@ -33,7 +33,7 @@ static ssize_t sta_ ##name## _read(struct file *file,                 \
 #define STA_OPS(name)                                                  \
 static const struct file_operations sta_ ##name## _ops = {             \
        .read = sta_##name##_read,                                      \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 }
 
@@ -41,7 +41,7 @@ static const struct file_operations sta_ ##name## _ops = {            \
 static const struct file_operations sta_ ##name## _ops = {             \
        .read = sta_##name##_read,                                      \
        .write = sta_##name##_write,                                    \
-       .open = mac80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 }
 
index b4f7600a3e36c010f6d428ad0461db2324087dc3..3313c117b322a928d17586c766c66bb698ca17bf 100644 (file)
@@ -145,7 +145,7 @@ static ssize_t rcname_read(struct file *file, char __user *userbuf,
 
 static const struct file_operations rcname_ops = {
        .read = rcname_read,
-       .open = mac80211_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 #endif
index 39765bcfb472c7299d0bb45dd0c6dc1627fc283c..920cabe0461b30cd7c5ef9d59e0f010a3bfa4297 100644 (file)
 #include "core.h"
 #include "debugfs.h"
 
-static int cfg80211_open_file_generic(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 #define DEBUGFS_READONLY_FILE(name, buflen, fmt, value...)             \
 static ssize_t name## _read(struct file *file, char __user *userbuf,   \
                            size_t count, loff_t *ppos)                 \
@@ -33,7 +27,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf,  \
                                                                        \
 static const struct file_operations name## _ops = {                    \
        .read = name## _read,                                           \
-       .open = cfg80211_open_file_generic,                             \
+       .open = simple_open,                                            \
        .llseek = generic_file_llseek,                                  \
 };
 
@@ -102,7 +96,7 @@ static ssize_t ht40allow_map_read(struct file *file,
 
 static const struct file_operations ht40allow_map_ops = {
        .read = ht40allow_map_read,
-       .open = cfg80211_open_file_generic,
+       .open = simple_open,
        .llseek = default_llseek,
 };
 
diff --git a/scripts/coccinelle/api/simple_open.cocci b/scripts/coccinelle/api/simple_open.cocci
new file mode 100644 (file)
index 0000000..05962f7
--- /dev/null
@@ -0,0 +1,70 @@
+/// This removes an open coded simple_open() function
+/// and replaces file operations references to the function
+/// with simple_open() instead.
+///
+// Confidence: High
+// Comments:
+// Options: -no_includes -include_headers
+
+virtual patch
+virtual report
+
+@ open depends on patch @
+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,
+...
+};
+
+@ openr depends on report @
+identifier open_f != simple_open;
+identifier i, f;
+position p;
+@@
+int open_f@p(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_openr depends on openr @
+identifier fops;
+identifier openr.open_f;
+position p;
+@@
+struct file_operations fops = {
+...,
+.open = open_f@p,
+...
+};
+
+@script:python@
+pf << openr.p;
+ps << has_openr.p;
+@@
+
+coccilib.report.print_report(pf[0],"WARNING opportunity for simple_open, see also structure on line %s"%(ps[0].line))
index 601df809a26a857bbcc4c007e72afcab99138fd8..1765a197acb0ab14d0a54cda8751dd45fa7b71fb 100644 (file)
@@ -40,12 +40,6 @@ static void __iomem *audmux_base;
 #ifdef CONFIG_DEBUG_FS
 static struct dentry *audmux_debugfs_root;
 
-static int audmux_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 /* There is an annoying discontinuity in the SSI numbering with regard
  * to the Linux number of the devices */
 static const char *audmux_port_string(int port)
@@ -142,7 +136,7 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
 }
 
 static const struct file_operations audmux_debugfs_fops = {
-       .open = audmux_open_file,
+       .open = simple_open,
        .read = audmux_read_file,
        .llseek = default_llseek,
 };
index a4deebc0801ab2e8ec5f3864b3cd1d1dc9aa7780..e19c24ade414a3eef34073f6f98da139c8ff8b5a 100644 (file)
@@ -201,12 +201,6 @@ static ssize_t pmdown_time_set(struct device *dev,
 static DEVICE_ATTR(pmdown_time, 0644, pmdown_time_show, pmdown_time_set);
 
 #ifdef CONFIG_DEBUG_FS
-static int codec_reg_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t codec_reg_read_file(struct file *file, char __user *user_buf,
                                   size_t count, loff_t *ppos)
 {
@@ -264,7 +258,7 @@ static ssize_t codec_reg_write_file(struct file *file,
 }
 
 static const struct file_operations codec_reg_fops = {
-       .open = codec_reg_open_file,
+       .open = simple_open,
        .read = codec_reg_read_file,
        .write = codec_reg_write_file,
        .llseek = default_llseek,
index 6241490fff30e2e850e4be82e177bb6656ecfbc0..5cbd2d7623b8cbf611db0e123ef4d8a01e6f88b0 100644 (file)
@@ -1544,12 +1544,6 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
 }
 
 #ifdef CONFIG_DEBUG_FS
-static int dapm_widget_power_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t dapm_widget_power_read_file(struct file *file,
                                           char __user *user_buf,
                                           size_t count, loff_t *ppos)
@@ -1613,17 +1607,11 @@ static ssize_t dapm_widget_power_read_file(struct file *file,
 }
 
 static const struct file_operations dapm_widget_power_fops = {
-       .open = dapm_widget_power_open_file,
+       .open = simple_open,
        .read = dapm_widget_power_read_file,
        .llseek = default_llseek,
 };
 
-static int dapm_bias_open_file(struct inode *inode, struct file *file)
-{
-       file->private_data = inode->i_private;
-       return 0;
-}
-
 static ssize_t dapm_bias_read_file(struct file *file, char __user *user_buf,
                                   size_t count, loff_t *ppos)
 {
@@ -1654,7 +1642,7 @@ static ssize_t dapm_bias_read_file(struct file *file, char __user *user_buf,
 }
 
 static const struct file_operations dapm_bias_fops = {
-       .open = dapm_bias_open_file,
+       .open = simple_open,
        .read = dapm_bias_read_file,
        .llseek = default_llseek,
 };