diff options
author | Yangtao Li <tiny.windzz@gmail.com> | 2018-12-03 09:26:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-12-03 17:33:43 -0800 |
commit | 25079154f71170f615f67c33d47af1188117668b (patch) | |
tree | 5e71dcbc6fe1aecb4c61c97a66d3c9f2cad02d6a /drivers/net | |
parent | fb0d9c6339e0d8d1eb09414a09df8513499bbf79 (diff) | |
download | linux-25079154f71170f615f67c33d47af1188117668b.tar.bz2 |
net: qca_spi: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/qualcomm/qca_debug.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c index 1450f386bc65..bcb890b18a94 100644 --- a/drivers/net/ethernet/qualcomm/qca_debug.c +++ b/drivers/net/ethernet/qualcomm/qca_debug.c @@ -126,19 +126,7 @@ qcaspi_info_show(struct seq_file *s, void *what) return 0; } - -static int -qcaspi_info_open(struct inode *inode, struct file *file) -{ - return single_open(file, qcaspi_info_show, inode->i_private); -} - -static const struct file_operations qcaspi_info_ops = { - .open = qcaspi_info_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(qcaspi_info); void qcaspi_init_device_debugfs(struct qcaspi *qca) @@ -154,7 +142,7 @@ qcaspi_init_device_debugfs(struct qcaspi *qca) return; } debugfs_create_file("info", S_IFREG | 0444, device_root, qca, - &qcaspi_info_ops); + &qcaspi_info_fops); } void |