diff options
author | Yangtao Li <tiny.windzz@gmail.com> | 2018-12-15 03:53:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-17 14:24:42 +0100 |
commit | 0022290f1e12e87512d37dec702cab2090a91dc4 (patch) | |
tree | 64d7f402fb64f0853abefc4658d3b87df83a6fdf /drivers/staging/greybus | |
parent | 892cb81ecec9a7bf7c4224119959b21580a40870 (diff) | |
download | linux-0022290f1e12e87512d37dec702cab2090a91dc4.tar.gz linux-0022290f1e12e87512d37dec702cab2090a91dc4.tar.bz2 linux-0022290f1e12e87512d37dec702cab2090a91dc4.zip |
staging: greybus: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/loopback.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 28973c246474..48d85ebe404a 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -970,19 +970,7 @@ static int gb_loopback_dbgfs_latency_show(struct seq_file *s, void *unused) return gb_loopback_dbgfs_latency_show_common(s, &gb->kfifo_lat, &gb->mutex); } - -static int gb_loopback_latency_open(struct inode *inode, struct file *file) -{ - return single_open(file, gb_loopback_dbgfs_latency_show, - inode->i_private); -} - -static const struct file_operations gb_loopback_debugfs_latency_ops = { - .open = gb_loopback_latency_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(gb_loopback_dbgfs_latency); #define DEBUGFS_NAMELEN 32 @@ -1042,7 +1030,7 @@ static int gb_loopback_probe(struct gb_bundle *bundle, snprintf(name, sizeof(name), "raw_latency_%s", dev_name(&connection->bundle->dev)); gb->file = debugfs_create_file(name, S_IFREG | 0444, gb_dev.root, gb, - &gb_loopback_debugfs_latency_ops); + &gb_loopback_dbgfs_latency_fops); gb->id = ida_simple_get(&loopback_ida, 0, 0, GFP_KERNEL); if (gb->id < 0) { |