Skip to content

Commit

Permalink
USB: host: isp116x: Re-use DEFINE_SHOW_ATTRIBUTE() macro
Browse files Browse the repository at this point in the history
...instead of open coding file operations followed by custom ->open()
callbacks per each attribute.

Cc: Olav Kongas <ok@artecdesign.ee>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Mar 9, 2018
1 parent 64cfe86 commit 0a9e8ad
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions drivers/usb/host/isp116x-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ static void dump_int(struct seq_file *s, char *label, u32 mask)
mask & HCINT_SF ? " sof" : "", mask & HCINT_SO ? " so" : "");
}

static int isp116x_show_dbg(struct seq_file *s, void *unused)
static int isp116x_debug_show(struct seq_file *s, void *unused)
{
struct isp116x *isp116x = s->private;

Expand Down Expand Up @@ -1196,18 +1196,7 @@ static int isp116x_show_dbg(struct seq_file *s, void *unused)

return 0;
}

static int isp116x_open_seq(struct inode *inode, struct file *file)
{
return single_open(file, isp116x_show_dbg, inode->i_private);
}

static const struct file_operations isp116x_debug_fops = {
.open = isp116x_open_seq,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
DEFINE_SHOW_ATTRIBUTE(isp116x_debug);

static int create_debug_file(struct isp116x *isp116x)
{
Expand Down

0 comments on commit 0a9e8ad

Please sign in to comment.