diff options
Diffstat (limited to 'drivers/staging/rtlwifi/debug.c')
-rw-r--r-- | drivers/staging/rtlwifi/debug.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/staging/rtlwifi/debug.c b/drivers/staging/rtlwifi/debug.c index be8d72cb63db..8999feda29b4 100644 --- a/drivers/staging/rtlwifi/debug.c +++ b/drivers/staging/rtlwifi/debug.c @@ -1,19 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * * Copyright(c) 2009-2012 Realtek Corporation. * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * The full GNU General Public License is included in this distribution in the - * file called LICENSE. - * * Contact Information: * wlanfae <wlanfae@realtek.com> * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, @@ -106,7 +95,7 @@ static const struct file_operations file_ops_common = { .open = dl_debug_open_common, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int rtl_debug_get_mac_page(struct seq_file *m, void *v) @@ -496,18 +485,20 @@ static int rtl_debug_get_phydm_cmd(struct seq_file *m, void *v) static int rtl_debugfs_open_rw(struct inode *inode, struct file *filp) { + int ret = 0; + if (filp->f_mode & FMODE_READ) - single_open(filp, rtl_debug_get_common, inode->i_private); + ret = single_open(filp, rtl_debug_get_common, inode->i_private); else filp->private_data = inode->i_private; - return 0; + return ret; } static int rtl_debugfs_close_rw(struct inode *inode, struct file *filp) { if (filp->f_mode == FMODE_READ) - seq_release(inode, filp); + single_release(inode, filp); return 0; } @@ -530,12 +521,9 @@ static const struct file_operations file_ops_common_rw = { #define RTL_DEBUGFS_ADD_CORE(name, mode, fopname) \ do { \ rtl_debug_priv_ ##name.rtlpriv = rtlpriv; \ - if (!debugfs_create_file(#name, mode, \ - parent, &rtl_debug_priv_ ##name, \ - &file_ops_ ##fopname)) \ - pr_err("Unable to initialize debugfs:%s/%s\n", \ - rtlpriv->dbg.debugfs_name, \ - #name); \ + debugfs_create_file(#name, mode, parent, \ + &rtl_debug_priv_ ##name, \ + &file_ops_ ##fopname); \ } while (0) #define RTL_DEBUGFS_ADD(name) \ |